Ivory Search › Forums › Support › The AND versus OR option not working as expected
Tagged: and operator
- This topic has 7 replies, 2 voices, and was last updated 4 years, 5 months ago by Ivory Search.
You must be logged in to create new topic or reply to the topic. Click To Login
- AuthorPosts
- May 19, 2020 at 5:27 AM #4723
Hi
In the settings Option > Search All or Any Search Terms I have set this to AND. I want it to find any post with all the search terms entered. My form searches tags.
I have a post with 2 separate tags – ‘famous’ and ‘virgo’. These words are only in the tags.I then perform a search for ‘virgo famous’ expecting it to find any post with both ‘virgo’ and ‘famous’ anywhere in it.
But it doesn’t find anything.
If I change the tags in the post to a single tag, either ‘famous virgo’ or ‘virgo famous’, it does find it.
So it’s not looking for the terms as individual tags, but for any single tag that has both terms in it.
- May 19, 2020 at 7:59 PM #4739
I hope you are well today and thank you for your question.
The option “Search All or Any Search Terms” only applies to a single term and not multiple terms.
For example, If you have a term called “Hello World” and If you have set the option to AND then it only returns the result If you search for “Hello World” and not “Hello Friend” or if one term contains a word “Hello” and other “World”.
Best regards,
Ivory Search Support- May 20, 2020 at 2:34 AM #4748
Hi
But that is what I’m saying.
I have set up a post called ‘Sapphire – September’ on birthstonebuzz.com so you can see.
The plugin option is set to AND.
There are 2 tags on the post, one ‘ivory’ and one ‘search’.
If you search ‘ivory search’ or ‘search ivory’ it doesn’t find it.
- May 20, 2020 at 11:50 AM #4753
It seems I didn’t explain it clearly to you, therefore, you didn’t understand it.
Let me explain to you again, the AND condition is only considered for one tag and not on multiple tags that you are considering.
There are 2 tags on the post, one ‘ivory’ and one ‘search’.
If you search ‘ivory search’ or ‘search ivory’ it doesn’t find it.In this case, there isn’t any tag containing both the words ‘ivory search’ or ‘search ivory’ on your website therefore it doesn’t return anything. As said above it doesn’t consider multiple tags.
- May 20, 2020 at 12:38 PM #4754
What I am trying to do is have search find any post that includes all of the search words, but as individual words, not as a phrase.
I don’t want it to treat the words as a phrase unless they are surrounded by quotes. Ivory search does accept quotes around search words and correctly searches for a phrase if the quotes are used. And it also correctly searches in the title and description for individual words if the quotes are not used.
But you are saying it doesn’t do this in tags. Even though no quotes are used around the words, it searches tags as if it is a phrase and only returns the post if there is a tag that exactly matches the search words in the exact same order. So AND has no real effect in the tags.
That isn’t what I expected and hence my confusion. Just as it AND’s or OR’s words and phrases in the title and description, I thought it would do the same in tags and AND or OR tags together.
This is a problem as there is no way then to have it return a post if the individual words entered in the search, without quotes, are only in the tags as separate tags. They would have to be in tags as a single tag that exactly matches the search word for word in the same order. Like a phrase.
Is there anyway to have it return a post if the search is for say 3 words, without quotes, so it’s not a phrase, and the words are in separate tags?
- May 21, 2020 at 12:41 PM #4764
Currently, the plugin does not provide functionality that you are trying to achieve regarding the tags but we will consider this to be implemented in the future version of the plugin.
- May 21, 2020 at 1:31 PM #4765
That would be a good change as the way it is doesn’t logically apply an AND operator to tags. Thanks for the reply. Just means I can’t use it for what I intended and will have to rethink. Sadly, I love the plugin, but may have to use another.
- May 21, 2020 at 9:01 PM #4768
Sure, we will implement it in the future version of the plugin.
Do share here If you find any other plugin that achieves the desired functionality.
- AuthorPosts
You must be logged in to create new topic or reply to the topic. Click To Login