You are right that the built-in search normally requires every search word to match (AND). When it behaves like an OR search, something is usually altering the query — often a search-related plugin or the theme’s own search handling. It is worth noting that Relevanssi itself defaults to OR logic, so what you have been seeing may have come from that rather than core search. A quick test is to temporarily switch to a default theme and turn off search-related plugins, then compare the results before re-enabling them one by one to find the culprit.
Thanks for this. Relevanssi is set to AND and does that. If I switch it off, we go back to OR. I switched off two plugins that have a connection to categories along with Relevanssi and still got the OR search.
I hadn’t thought about the theme, but can’t see anything in its options that has any bearing on it. If it is something deep inside the theme’s code, then I’m stuck with the problem, and would be looking for a less bloaty plugin to replace Relevanssi.
I’ve found an alternative (thank you AI for once) with some coding which forces an AND search on the inbuilt WP search to override whatever code elsewhere was turning it into an OR. It works fine, so Relevanssi and its 3 million lines of data is now gone.
Hi, I realise I am a bit late to the party, and with a somewhat self-serving answer at that (being one of the founders behind the service I am telling you about): I just wanted to let you know about an alternative to Relevanssi that we have developed: SearchCue (plugin, site).
SearchCue offers AND by default, but a “smart AND” if you will. If the site visitor types a long query for which there isn’t a match, we selectively start dropping the less relevant terms (do look at word frequencies, etc, for this). Thereby we default to giving you matches that include all your words, but then opt for providing meaningful answers rather than no answer if there are no exact matches for all the terms.
Having just migrated the site and being told by the IT person doing it that the Relevanssi database had 3 million lines
SearchCue is also a hosted service, so there won’t ever be 3 million lines and no extra load on your database. That being said, I see your 3 million lines are now gone, thank God 🤪
Happy to answer any questions if you have any, and sorry for barging in on your thread.