36

As I see search terms in Search used with OR operator by default and I see no way to switch or force it to AND. For example I just queried [XTS mode] in the stackoverflow and all results were irrelevant (the moment before I read a post where both terms were used)

Google always used AND operator by default. As I recall from my experience the noticeable exception is phpBB that uses OR by default. I know that this can be a very long discussion, but the well-known search engines is a strong point on my side, aren't they?

EDIT: I just read about the feature that AND results should be at top. Not always actually, or with this approach (all shown, AND first), suggestion would be at least mark the sections, so to see there's no AND results at all.

I'd say that the search works strangely, two examples:

  • the query I posted [XTS Mode] didn't have XTS in the first result,

  • Query [Delphi Register] didn't have "register" in the first result, but googling [site:stackoverflow.com Delphi register] led to the article Calling a Delphi DLL from C# produces unexpected results that had both words

0

5 Answers 5

4

The new elasticsearch-backed search is using an AND operator by default now.

3
9

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

+apples +oranges

1
  • Jeff, that's probably a "good enough" solution for StackOverflow users, but what about, say, Cooking users? When was the last time a real search engine required users to use + to do an AND search? 1998? Why not just make all search AND, period?
    – devuxer
    Commented Mar 5, 2012 at 19:32
8

I agree. The default OR search is a complete violation of web design guidelines. If the results returned do not include all the terms searched for, this should be communicated to the user in some way.

4

I agree. My logic is this:

  • Google uses "and", not "or".
  • The vast majority of Internet search goes through Google.
  • Therefore, you should have an extremely good reason for not working like Google does.

Using "or" just confuses people. Having a workaround that allows "and" but isn't documented on the search tips page confuses people even more.

Jeff, could you at least add your answer above to the tips page, please?

1

Yes, I find this strange as well.

As a work around, you might be interested to know that you can do AND searches if you edit the URL directly:

https://stackoverflow.com/questions/tagged/python+optimization

Will return all questions matching both python and optimization.

4
  • Hmm, the general query in my case produces exactly the same query with pluses, i.e. "wrong" query already has pluses so I don't know what to change in order to get right results :)
    – Maksee
    Commented Sep 17, 2009 at 14:28
  • Have you double checked the entire url? When I type "python optimization" into the search box, I get: stackoverflow.com/search?q=python+optimization. This is not the same as the URL in my answer (my url is not a search). Commented Sep 17, 2009 at 14:43
  • @ire and curses, the URL in your answer is searching for questions tagged both python and optimization, the URL in the comment searches for posts tagged Python and containing the text optimization. StackOverflow automatically changes some search keywords to search based on tags, (blog.stackoverflow.com/2008/10/… towards the end of the post) Commented Sep 17, 2009 at 15:14
  • 1
    @Nathan Koop: Thanks for the clarification. I realise I misunderstood the OP - he is talking about string searches, not tag searches, although he uses the same square bracket syntax in his question. There is no XTS tag on SO. "[Delphi] register" works for the second example Commented Sep 17, 2009 at 15:47

You must log in to answer this question.

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