XF 1.2 Why Xenforo searches by titles with "AND" instead of "OR"?

Moshe1010

Well-known member
I'm wondering why XF built in search, and even Elastic Search, search titles by the combination of "AND" instead of "OR".

If I try to search right now a phrase based on titles only: "XCache PHP" (without the quotes)
It would search XCache AND PHP --> Only if these two words are in the title, it would find the thread.

However, on any other software that I've encountered so far, it searches with "OR", meaning if I search by titles only, it would search if the title has either XCache or PHP and would give me the output of any of them.

Thus, I'm wondering why this is working like this since it's making the search engine really ineffective.
(Not sure if this is the right place for this thread, but it does create a huge hassle with some search-based add-ons).
 
Last edited:
You can switch it to OR if you want, but frankly, I don't think I've seen any software that is OR by default. Google is effectively AND by default.
 
You can switch it to OR if you want, but frankly, I don't think I've seen any software that is OR by default. Google is effectively AND by default.
How can I switch to OR? Google is AND only if you search with quotes. If you don't search with quotes it's OR by default.
vB 4 works the same way, as well as Sphinx.
 
Use "|" between words.

Quotes is a phrase search. It means those words in exactly that order. This is different than an AND search.

Google does AND by default, see here: https://support.google.com/websearch/answer/136861
If you want to search for pages that may have just one of several words, include OR (capitalized) between the words. Without the OR, your results would typically show only pages that match both terms.
 
Use OR between words.

Quotes is a phrase search. It means those words in exactly that order. This is different than an AND search.

Google does AND by default, see here: https://support.google.com/websearch/answer/136861
Yes, but you can't really search for titles on Google, so if you search X+Y, it can find X on the title and Y in the content or the page (or even URL). Try to search on any big vB 4 (or even 3) board, and you will see that it breaks the phrase to OR by default. It's much more effective that way (in my opinion of course) to search with OR when it's based on titles since there is much smaller chance that both (or more) of your words appear in a single title.

About using OR, do you mean instead of "XCache PHP" to use "XCache OR PHP"? based on title search only, it gives me the same result.
 
Yes "|" works - "OR" doesn't. Is there anything written about that or is that something that everybody knows?
I've never seen anything like this, and it may help to add this to the FAQ or something like this (if it's not there yet).

Thanks for the help - I would still suggest doing it by default, but that's your call.
 
Back
Top Bottom