29

A lot of people were unhappy that the old search defaulted to OR, and I agreed.

With the change of Stack Exchange's search engine it now defaults to AND and everybody is happy.

But actually sometimes I do want to use OR. There's plenty of concepts that can be expressed in different ways or with different vocabulary. In these cases I like to use OR between synonyms:

  • url OR uri schema OR protocol
  • seek OR fseek
  • options OR prefs OR preferences OR settings OR config
  • folder OR dir OR directory
  • parameter OR param OR argument OR arg

I've tried or, OR, and | but none seem to work. Nothing is mentioned under "Advanced Search Tips".

(I'm tagging support in case it's there but I can't find it and feature-request in case it's not there.)

4
  • 1
    I think the problem with both systems is that it is not obvious how to mark terms optional or required, or how weighting works. I was expecting -term for forbidden and +term for required, but that doesn’t quite seem to work. I think the forbidden may work though.
    – tchrist
    Jan 13, 2013 at 16:23
  • Otherwise a single argument like ORQUERY (or any other words) would be nice to copy former behavior. Jan 17, 2013 at 15:00
  • 1
    @BethWhitezel Not a duplicate; that one's just about tags, while this one is about all search terms. Mar 22, 2014 at 5:52

4 Answers 4

5

I got zero results doing the search [php] or [mysql], and realized that the Advanced Search Tips don't say how to do an 'OR' search (and also I found the Search Page referenced in the FAQ is no longer there).

I found the following situations:

  1. For doing tag only searches you can use [php] [or] [mysql]
  2. For word searches you can use php or mysql
  3. For phrase searches (with quotes on words) I couldn't get either to work, if you use single quotes, then it seems like you actually get an 'and' search

Could we please have a definitive explanation or doing OR searches in SE?

3
  • shouldn't that mean that "php or FakeWordThatNoOneWillEverWriteInAQuestion" should return all question with php in the text? Just tried it and returned 0 results, so I fear number 2 is wrong.
    – SPArcheon
    Jan 28, 2013 at 14:15
  • @SPArchaeologist, hmmm, looks like I was wrong, have edited. Jan 28, 2013 at 14:22
  • 1
    BTW, just tried "php [or] FakeWordThatNoOneWillEverWriteInAQuestion" and that doesn't work too
    – SPArcheon
    Jan 28, 2013 at 14:35
5
+100

According to this comment there isn't a way to do this. Apparently the search engine never handled it.

2

Another case in which OR doesn't seem to work is the user: operator.

Searching user:1 OR user:2 only finds posts by user 2 and says «results found containing or search options user 2». Apparently the "redundant" operator is just ignored.

2

If you are able to limit your search scope well enough (say: within a single tag) you can use the Stack Exchange Data Explorer.

Here is a query to get you going:

Search for 3 OR terms in the Body of posts within a tag

You must log in to answer this question.

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