I have a product search which search’s the title of the products.
This is set in the query as 'products contains “search query” which works ok.
HOWEVER…
The issues I am having is if there is a product title such as ‘Savage Magazine 223’ you have to get the right order of the title.
What I need it to do is pull out anything that has for example in the the title ‘Savage 223’
Does anyone have any ideas how this can be done.
I had a similar situation before, I had to use a split on the space and change contains to IN. @TomD may have a sample of something like this, I think he does this a lot.
You can use the split formatter in the query filters and use it like: $_GET.filter.split(" ")[0] for the first term, $_GET.filter.split(" ")[1] for the second $_GET.filter.split(" ")[2] for the third etc.
So in the query builder you do:
So this will show all the results containing the first or second or third word of the $_GET.filter string.
It’s up to you to decide how many words to get - 3, 5 or more.