I have been having issues with the Kirby search since I implemented it:
If I search for “hi” when none of my content has “hi” as a word within it, the search still returns several results, because each has the word “which”, as it contains “hi” inside of it: which.
However, I really would prefer a more standard search functionality: one that would return 0 results in the above case because no content has the word “hi”.
Thanks, however, the problem is that I can only seem to apply one of those possible parameters/defaults in the array list in the link at a time. And I already need to use the one that filters ‘fields’.
I also need to know how to apply the 'words' => true parameter to the code shown in my controller (code above), which uses a slightly different code than shown in the search documentation examples. This is because I am calling the plugin that allows for “and” searches instead of just “or” searches when entering more than one word.
I tried adding to the “return array” part of my code, but it didn’t work:
return array(
‘query’ => $query,
‘results’ => $results,
‘words’ => true
);
Either way, with my controller code and with trying the method in the documentation examples, I would need to know how to call more than one “possible parameters/defaults”? Does anyone know how to make this happen? Thanks!!!
I just tested that exact line of code, but it’s not working…now both the ‘words’ isn’t working, and also the filtering by just ‘text’ and ‘title’ is also not working.
Does it work for you? Any ideas? Thanks so much for the suggestions!
Well, yes, the words option does not work with the plugin, because the plugin has been modified to work with exact matches only, no matter if these are within word boundaries or not. You would have to find a regex pattern that does not ignore word boundaries.