1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Troubleshooting and Problems' started by Moshe1010, Jul 9, 2013.

  1. Moshe1010

    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: Jul 9, 2013
  2. Mike

    Mike XenForo Developer Staff Member

    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.
     
  3. Moshe1010

    Moshe1010 Well-Known Member

    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.
     
  4. Mike

    Mike XenForo Developer Staff Member

    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
     
  5. Moshe1010

    Moshe1010 Well-Known Member

    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.
     
    Shakir likes this.
  6. Mike

    Mike XenForo Developer Staff Member

    I edited my post - it's actually "|" that I meant there (xcache | php).
     
  7. Moshe1010

    Moshe1010 Well-Known Member

    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.
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    I will be updating the FAQs soon, once the software reaches RC status.
     

Share This Page