7

Example use case: Movies & TV has a lot of poor questions tagged "identify-this-movie" or "identify-this-tv-show" which clog up the main questions list and make it harder to find good content. So what's the solution? Do a search for questions that don't contain the tag, using the negation operator for one or both of the tags. Unfortunately, such searches return 0 results, falsely implying that ALL of the questions on that site have one of those tags. It also unexpectedly wraps the query in double quotes.

According to this answer, negative tags are supported "as long as the negative tag isn't the only thing in your search." This answer elaborates that tag-negative searches return empty 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.

I don't quite buy that argument, especially when "-[identify-this-movie] -[identify-this-tv-show] -identify" or even just "-identify" work as a valid queries, and single-word exclusion seems like it should have poorer performance than tag exclusion.

The workaround is to add something like is:question (or the shorter is:q, not documented in the Advanced Search Tips) to the query. (It also works in this example). Since answers aren't tagged in the way questions are, it seems likely that someone searching with a negative tag query is likely looking for questions that don't have those tags, and returning a result set to match that intention seems more likely to be useful than returning "0 results" (and a query with strangely added quotes) with no indication of what went wrong or what a user can do about it.

Therefore, I make this feature request to alter the search behavior so that queries which would otherwise return empty because they are negative-tag-only queries, behave as if "is:question" had been appended to the start of the query.

From an implementation perspective, I imagine that somewhere in the query-handling code there is a check to see if the query meets certain specifications, then add double quotes, return 0 results, and don't bother telling the user why. I'm proposing a change to what happens inside the then block. If for some reason we can't change this behavior to something more useful, we should at the very least explain what's happened.

  • Makes sense, although if is:answer is explicitly given, the is:question must be removed as when searching for both, the is:question "wins" so it will cause nobody will be able to search for answers only. – Shadow The Dragon Wizard Mar 11 '16 at 18:29
  • 1
    @ShadowWizard If is:answer is explicitly given, it's not a negative-tag-only query, so this requested change would not apply. – WBT Mar 11 '16 at 18:32
  • oooops, right about that. My bad! :( – Shadow The Dragon Wizard Mar 11 '16 at 18:53
  • @ShadowWizard no problem, it would have been a helpful potential-secondary-issue to know about if it did apply! – WBT Mar 11 '16 at 18:56

You must log in to answer this question.

Browse other questions tagged .