Forums › Forums › Search & Filter Pro › Wildcard for empty fields
Tagged: empy field, wildcard
- This topic has 8 replies, 2 voices, and was last updated 7 years ago by Trevor.
-
Anonymous(Private) November 10, 2017 at 9:20 am #141122
I have a catalogue.
Each product is a separate Post.
They have ACF fields like these:Product Code
Product Series
Category
Width
Height
WeightSome product have one or two fields that are not filled.
EG, they miss Width and/or Weight.When I do a search, the items that have these fields void are excluded from the results.
Field relationships are set as “AND”.
ACF for Width and Weight are set as number fields.Is there a way to set a wildcard for these fileds that are not filled so that they won’t be excluded from results?
Trevor(Private) November 10, 2017 at 9:37 am #141127Are these meta keys being searched with a Range field, because that would cause the problem. At this time you can sort of work around it (by using the Edit Query Argument filter to remove the unwanted range parameters). There will be snippets other users have posted on how they did this if you search for:
sf_input_object_pre range
Anonymous(Private) November 10, 2017 at 11:01 am #141131Hmmm… ok, if I’ve understood right, one of these snippets should cut out the unneeded parameters. but I’m not finding how to do it. I’ve seen that by modifyng the parameters in the url I can get the right search but that way I’m changing “the question” while I need to change “the answer” and actually I don’t know how to achieve it with code. I guees I’d need something that allow to search for a particular range only if its field has a value….
Trevor(Private) November 10, 2017 at 11:34 am #141133Yes, you remove the condition entirely. Try doing a search now, see the URL has the range in it? Edit that out in the URL and you will see the effect. Try doing the search without the word ‘range’, because I know someone has posted their solution.
Anonymous(Private) November 10, 2017 at 12:17 pm #141135Do you mean to open the url
https://support.searchandfilter.com/forums/search/sf_input_object_pre/
instead of
https://support.searchandfilter.com/forums/search/sf_input_object_pre+range/ ?I’m afraid i’ll need some more help Trevor, in any case I really appreciate your fast answers…
-
AuthorPosts