63

Search is defaulting to an OR combination of the search terms, which IMHO is a mistake (and also, BTW not the default on Google). I would prefer search to default to ANDing the terms instead of ORing or at least have the possibility to configure this as a preference.

4
  • 1
    Possible dup? meta.stackexchange.com/questions/22388/… Feb 23, 2010 at 2:00
  • 7
    If the community is split, or not enough people would like the search terms to be inclusive only (which I personally would like to see), an alternative would be to "weight" all the search results that do have all the search terms to the top. Aug 17, 2010 at 10:02
  • 1
    @NatePinchot: While I think that would work OK for the "relevancy" ordering, I don't see how you would make that work with the other ones like "votes" or "active". One of my main issues with the current search is how poorly it interacts with those sort orderings.
    – hammar
    Feb 24, 2012 at 15:16
  • Trying stackoverflow right now and it seems that now the default is AND? I must have missed the update buy can anyone confirm this?
    – AlfaTeK
    Oct 9, 2013 at 19:51

5 Answers 5

28

To all the critics: "And" is the default in all decent search engines. It just makes sense: if you are adding keywords you want fewer results.

2
  • 2
    No its not. Search for content management system comparison vs and the first result doesn't have the term vs anywhere in that document (vs isn't a stop word because its highlighted in the summary of many other search hits) It often seems like terms are anded but in reality Google is just sorting the results by relevance well enough so that results which match all terms usually appear near the top.
    – Justin
    Feb 24, 2012 at 15:32
  • 3
    I don't think that's the point. The discussion is between AND or OR and clearly every search engine doesn't use OR but AND (even if not a strict AND in some cases as you pointed out).
    – AlfaTeK
    Feb 25, 2012 at 2:53
14

This has been annoying me for some time now, and I'm hoping this could be reconsidered.

  1. It is unintuitive. Most search engines, most notably Google, have trained people to narrow their search by adding more keywords, but with OR search doing this actually broadens the search, making it less specific. Since it's not even obvious that this is happening, I suspect a lot of people probably just give up on using the built-in search, possibly leading to more duplication.

  2. It is inconsistent with the other search operators, including tags, which require that all of them must match (i.e. AND).

  3. OR search only works with the "relevancy" ordering. I often find myself looking for a question I knew was popular, but when I try ordering by votes, I inevitably end up having one of my keywords match one of the top questions, and adding more keywords only makes it worse. Similarly, sorting by "active" is also not very useful.

While it is possible to work around this by prefixing every search keyword with +, I think this is a hassle and easy to forget. The system should be optimized for the common case, which in my experience is AND-search.

1
  • 1
    +1 for point 3. I encounter that problem way too much.
    – Rob W
    Feb 24, 2012 at 15:02
11

This is now implemented in a simpler way; just begin each word with a + if it must appear in your results, eg:

+apples +oranges

2
  • 14
    Cool! Any chance of getting this as the default or at least a preference? Feb 11, 2010 at 19:51
  • 1
    "...implemented in a simpler way", I disagree with the italicized word
    – ajax333221
    Aug 12, 2012 at 23:23
2
+150

+1. Search functionality of any sort is only useful when there are enough items that it's not feasible to look through all of them to find what you want. Therefore it's obvious that setting a single search term will limit the list of items that you have to browse through to find what you want. And by inductive reasoning users will expect that since adding 1 term reduced the list of items, adding another term will further reduce it. Q.E.D.

-0.8. In the actual search string the semantics of - and + are obvious, and their precedence is also obviously equal. But if search is and-centric, is there any ASCII character which can signify boolean or and establish the precedence of it relative to -? That is (using | as the or symbol for illustration), can a normal user be expected to divine the meaning of framework -javascript |rails? I think not.

-0.3. If searches are ranked by the number of matched keywords (weighted for rarity, of course) then the or-centric first results are similar (and possibly equal) to the and-centric result, and it allows for a bit of typos and adding of words which are in fact not in the post.

But too late to change my vote.

-1

ANDing instead of ORing is a bad idea, lets use an example - someone is searching for

how to create a master page in C# asp.net

By default these terms are ORd together, and the results ranked and sorted by the frequency that each term appears in the document (for example the term "C#" is far more common than the term "Page" or "Master" and so when scoring pages more emphasis is given to these terms). The end result is many pages, however because of the ranking the ones that contain most or all of the given terms end up at the top of the results.

However crucially note that although results that contain all terms are favoured, results don't have to contain all the terms - for example there may be many useful questions on master pages that don't use the words "how" or "to" (which are not considered stop words).

3
  • I think this would be solved better by adding more stop words.
    – hammar
    Feb 24, 2012 at 14:55
  • @hammar However many stop words you add you can still come up with an example that shows these problems. For example what happens if the top ranking result was language agnostic and used the term .Net and not C#? Anding together results means that result no longer appears because it doesn't contain the term C#. You can't make C# a stop word!
    – Justin
    Feb 24, 2012 at 15:31
  • Since most search engines already work this way, I think people know how to tweak their queries to get what they want in such situations.
    – hammar
    Feb 24, 2012 at 18:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .