2

This question already has an answer here:

I'm trying to find questions that I can answer. So I reviewed advanced search help page, and I found answers:0 which helps me avoid questions that already have answers and locked:false to avoid locked questions.

What I would like to do is limit questions to those that have one of the tags in a list. For example, if I search for [python] [php], then I only get questions that have both tags. How do I get those that have either one?

marked as duplicate by Rob, Ward, Robert Longson, Sonic the Anonymous Hedgehog, Nathan Tuggy Mar 9 at 4:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • When I was searching through meta, I didn't find that question. Looking at it now, it's more generic, and this one might be easier to find. Especially considering that one of the answers is that it's impossible. – Granny Aching Mar 8 at 20:16
2

Use the or operator.

From the help page:

OR operator

To combine results from multiple tags, separate the tag names (enclosed in square brackets) with the word "or": [widgets] or [geegaws] returns questions tagged with either tag.

Example search on Stack Overflow for [php] or [python].

Works for more than two tags, as this example search [php] or [python] or [javascript] shows.

Example search with a more complex search term [php] or [python] or [javascript] closed:no is:question score:1 hasaccepted:no.

  • This works! And I just realized that it's on the help page. I was blind... – Granny Aching Mar 8 at 16:56
1

To my knowledge there is no way to answer your question with a single search. However you can run 2 queries as in this sample:

  • [python] -[php] is:q (= questions tagged with python and NOT tagged with php).
  • -[python] [php] is:q (= questions tagged with php and NOT tagged with python).
  • [python] [php] is:q (= questions tagged with php AND tagged with python).

And BTW, you may want to try a search variation like so:

[python] -[php] closed:0 is:q score:1 hasaccepted:no

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