What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 129 Stack Exchange communities.

Entering "comprehension" [-list-comprehension] in the search box results in the following url : http://stackoverflow.com/search?q=x%22comprehension%22+[-list-comprehension] and on the right hand side bar the following is displayed:

posts containing

"comprehension"

within these tags not list-comprehension

So far things are correct. However all the question that do have the list-comprehension tag, the exact opposite of what the result should have been. Can you please fix this?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

We now support this, as long as the negative tag isn't the only thing in your search. Also note that the - should precede the tag entirely, rather than be inside.

Here's your search: "comprehension" -[list-comprehension]
...and just to show the exclude is working, here it is without the negative tag: "comprehension"

share|improve this answer

Unfortunately this behaviour is by design.

For performance reasons, the tag-based NOT operator is disallowed when supplying a single tag. This is because the set of questions without a single tag is a huge set of questions. So the system makes you specify a second tag to bound the results (i.e., search for all questions with tag1, but don't also have tag2). In the disallowed case, the system simply flips the logic on the single tag so the result set is guaranteed to be bounded.

As you saw, the system correctly interpreted your intentions, but the input transformation isn't obvious.

Note also that even when specifying -, the tag with the NOT cannot appear as the first tag in the sequence.

share|improve this answer

Since the - operator is undocumented, it's hard to say if the bug is in how the search is working or in how the sidebar is interpreting the results.

Using the Google search box with "comprehension" -list-comprehension seems to work.

share|improve this answer

You must log in to answer this question.

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