searchable
searchable copied to clipboard
Multiple search terms
How should I use the package for multiple search terms?
For instance, if I'm searching for textures and write "metal golden" where "metal" something belonging to the Category table, while "golden" belongs to the Tag table, I'm only getting results which conform to metal, but the search ends there.
This is quite urgent, so any help is appreciated.
why not search both models and then merge your two returned collections?
Because this would force the app to run N queries for N search terms and array_merge those N collections. Or perhaps I didn't understand correctly?
you have n terms on 2 models, that would be 2*n queries, with array_merge 2 collections
@GregoryClaeyssens I'm having an urgent issue - maybe you could help me with this. So, if I search for "wood" (a tag), I get 20 results. However if I search for "worn wood", instead of narrowing down my search, I'm getting even more results. I think this has an OR logic instead of an AND logic. Is there any way to go around it? Thanks!
@sergiocastrovale that's possible here https://github.com/ajcastro/searchable