I have products with multiple fields than can be searched (name, text, product code, etc).
What I want to do is explode the search string and make sure that every word is found somewhere at the record.
With one word I would normally do like:
'OR'=>array(
'name LIKE'=>'%' . $oneword . '%',
'text LIKE'=>'%' . $oneword . '%',
'code LIKE'=>'%' . $oneword . '%',
)
Now I feel that I have to make as many OR-arrays as search string has words and include them all in AND-array. I just don’t know how to code it.
Something like this should do it
Edit: If all your search term must be present in any of the fields, it would be something like this: