Examine Search results to show results that have empty strings
Hi All,
I'm exploring the word of examine to do some searching for all 'products' and I'm trying to get examine to pick up the pages that do not have anything entered:
E.g
If the user lands on the page when it's not filtering by the category of design I want to show all the products (those with designs and those without anything entered as design is not a mandatory field) but if the user does search by design then I want to show the designs for what they're searching for.
The way I currently have examine set up doesn't cater for this as I create an array of all options and search for this when nothing is being searched for meaning the empty string found on the products that dont have anything entered are not being found. Then when something is being searched for I only search for this one.
Could anyone shed some light on this?
I basically want my searcher to add fields that are null or empty to the results list unless its being searched for.
gender array is set to all genders unless it's being searched for then its set to the searched for gender. The same goes for design which is why pages without anything entered for design or gender are not being found as their results of null or empty are not within the array
Examine Search results to show results that have empty strings
Hi All,
I'm exploring the word of examine to do some searching for all 'products' and I'm trying to get examine to pick up the pages that do not have anything entered:
E.g
If the user lands on the page when it's not filtering by the category of design I want to show all the products (those with designs and those without anything entered as design is not a mandatory field) but if the user does search by design then I want to show the designs for what they're searching for.
The way I currently have examine set up doesn't cater for this as I create an array of all options and search for this when nothing is being searched for meaning the empty string found on the products that dont have anything entered are not being found. Then when something is being searched for I only search for this one.
Could anyone shed some light on this?
I basically want my searcher to add fields that are null or empty to the results list unless its being searched for.
Current query
gender array is set to all genders unless it's being searched for then its set to the searched for gender. The same goes for design which is why pages without anything entered for design or gender are not being found as their results of null or empty are not within the array
Thanks,
Lewis
Hi Lewis,
You should be able to build up the query based on if each search parameter has any values or not. Something like this might be along the right lines:
You should be able to expand this out to fit the exact requirements for your search.
Thanks,
Paul
is working on a reply...