10

I would like to do a search on stackoverflow for all questions tagged:

([concurrent] or [multithreading]) and ([c] or [c++])

I'd even be happy if I could do a search for ([c] or [c++]) and [multithreading].

But I can't figure out the syntax.

Edit: part of the problem (as pointed out be @Hugo) is that the box in the upper right corner that tells you what you queried doesn't parenthesize correctly. Querying ([c] or [c++])[multithreading] is:question (which really returns the right thing) says it returns:

enter image description here

(which is the same picture you'll get if you query [c] or ([c++][multithreading])!

Edit 2: A second part of the problem is that the or operator seems to behave differently than the [or] operator. Sometimes one works, sometimes not, sometimes the other. A third part of the problem is that adding the is:question qualifier seems to dramatically change the results. (See the comments below @Hugo's answer.)

I've tried [multithreading]([c] or [c++]) (and ([c] or [c++]) [multithreading]) but get questions tagged [c] or ([c++] and [multithreading]).

I've tried [multithreading]([c] [or] [c++]) bug got questions tagged ([multithreading] and [c]) or [c++].

I've tried [c][multithreading] or [c++][multithreading] but get questions tagged [multithreading] or ([c++] and [c] and [multithreading])???

On the other hand [c][multithreading] [or] [c++][multithreading] seems to work but [c][multithreading] [or] [c++][multithreading] is:question returns nothing.

Even stranger querying [multithreading][c] or [multithreading][c++] gives questions tagged [c] or ([multithreading] and [multithreading] and [c++]) (yes, [multithreading] twice!)

How do I do a search that involves both "and" and "or" operators? Is there a predictable syntax I should be using?

2
  • @Telthien: I orginally had this as [support] but changed it to [bug] when it became clear (as I discussed it with the answerer, and did my edits) that there are a lot of serious problems with the search feature. You changed it back to [support], so you must disagree. What should I do to report the bugs? Apr 11, 2013 at 18:44
  • My reasoning for changing it to support was, even though this reveals bugs in the system, it's technically a support question ("How d o I do a..."). If you have found bugs, you can start a new question to report them, though!
    – user206222
    Apr 11, 2013 at 18:45

1 Answer 1

6

Searching [multithreading]([c] or [c++]) is:question does work. But it does need the is:question else the search results are completely non-relevant.

Here are some results (in the search) that I found that corresponds to borderline cases :

I think these covers all the possible case of what you wanted.


([concurrent] or [multithreading])([c] or [c++]) is:question seems to work as expected also. (With the is:question only, else it does not work.)


Your parenthesis are wrong I think. It's written [c] or [c++][multithreading] which seems to mean ([c] or [c++])[multithreading]. The ORs seem to have precedence over the ANDs (in the UI)

When you put this ([concurrent] or [multithreading])([c] or [c++]) it outputs [concurrent] or [multithreading][c] or [c++]. And the precedence goes to ORs, as you can see because of the search results covering all possible cases.

6
  • Interesting that adding is:question gets the right result (even though the box on the right still says you are getting [c] or ([c++] and [multithreading]). Why? Apr 11, 2013 at 17:03
  • @WanderingLogic I've edited! I do think it's just because they don't output parenthesis. Apr 11, 2013 at 17:06
  • Okay, even more bizarre. [c][multithreading] [or] [c++][multithreading] (note the brackets around or) works (the box on the right actually is correct in this case too.) But: [c][multithreading] [or] [c++][multithreading] is:question returns nothing! Apr 11, 2013 at 17:07
  • @WanderingLogic this one is weird ! Really don't know why! Apr 11, 2013 at 17:08
  • I see what you mean about them not outputting the parens, but there is still something very broken here. [multithreading]([c] or [c++]) (no is:question) really is outputting [c] or ([c++] and [multithreading]). The first 6 results have nothing to do with either multithreading or c++ stackoverflow.com/questions/tagged/…. Apr 11, 2013 at 17:15
  • @WanderingLogic that's effectively weird u_U! Apr 11, 2013 at 17:20

You must log in to answer this question.

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