?s=term1+term2
will do an OR search, if that’s what you have in your settings.
If you’re using quotes, that’s forcing phrase search, which may confuse the issue.
You may want to check that you’re actually getting results from Relevanssi. If you disable Relevanssi, do the results change?
Hi Mikko,
I must warn you, I am not a WordPress or a Relevanssi developer, I have merely been dumped with this issue so may need some hand holding.
It is a phrase search we want to do, basically we want to search all posts in the site that contain either “phrase 1” or “phrase 2”.
if I don’t have quotes it seems to work, so as you say, searching for
?s=phrase+2+phrase+1
returns all posts with either the word PHRASE, 1 or 2 in it which is what I expect. is there a way to do a phrase search so that any post is returned where it contains
“phrase 1” OR “phrase 2”
Searching for phrase or 1 or 2 gives too much of a wide search space which we want to narrow down.
If this isn’t possible at least I know not to waste my time trying to make relevanssi do it! 🙂
Thanks
Dean
Also to add more information, if I search for ?s=car+plane+boat all posts that contain any of the search terms come up.
if I search for ?s=”car”+”plane”+”boat” only posts that contain ALL of those search terms come up.
So basically, is there a way to make an OR based search term when using phrases?
Thanks
Dean
No, there’s not. When you add a phrase, Relevanssi requires that all the results contain that phrase. You can’t get an OR search when phrases are involved.
Thanks Mikko!
Can I put a request in for this functionality to be included in the development roadmap?
Thanks
Dean
Sure, but with the way the phrase searching functionality is implemented, it’s unlikely to change soon.