Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates


Could we get the -[tag] and -word usage documented on the search tips page?

As Tim notes in the comments, it appears the "-" operator doesn't work for words, just tags. (Is there a reason for this? Is it too expensive an operation?) (See Nick's answer.)

I also propose that we give some sort of warning when -word is used in a search, like:

The minus operator can only be used with tags. Did you mean to type -[word]?

Below is the original version of this post.

At the time I posted this, the search [ndk] -[android] -[android-ndk] -android returned no results, despite the fact that this question was tagged [c++] [cocos2d-iphone] [cygwin] [ndk] [rtti] and did not mention "android" anywhere, nor did its answer. This question should therefore have shown up in the search results, right?

isn't a special Android tag with the little green icon, unlike , so this behavior is unexpected to me. Is it because mentions Android in its wiki?

Related: Merge [ndk] into [android-ndk] and blacklist the former one

share|improve this question
It's because search thinks you want posts tagged ndk, not tagged android or android-ndk, and with the literal text "-android", although it's probably ignoring the hyphen and looking for "android" directly, which, as you've mentioned, that post doesn't contain. Hmm, does the - operator even work for non-tags? – Tim Stone Nov 24 '11 at 20:08
@TimStone Hmm, thanks for the tip. -"android" doesn't seem to help. - appears to be undocumented in the first place, so I suppose I should be grateful it even works for tags :P – Matthew Read Nov 24 '11 at 20:10
I think it does work with text, just perhaps not if tags are also present? (In which case it seems to be looking for the literal text "-term") – Tim Stone Nov 24 '11 at 20:30
@TimStone Well that is just unhelpful. Hopefully someone from SE clarifies. – Matthew Read Nov 24 '11 at 20:32

"The minus operator can only be used with tags" isn't accurate, the - operator works on text terms as well, it's just not working in this case.

The reason you're getting no results here is you can't search for only the absence of a word. If you were something for something and not nothing, then you'd get a result, for example:

We can look into supporting this, but it's not a trivial change due to how tags are worked in here (they're handled separately to some degree). Lucene currently sees your search as only the absence of a term, not even recognizing that there is some restriction (the tags) in place narrowing the result set. I'll see what we can do here.

share|improve this answer
Ahhh, of course. That makes much more sense, thanks for the clarification! – Tim Stone Nov 25 '11 at 14:18
That's cool. I'm fine with how it works (though thanks for looking into it, that would be even better), but can we get that spelled out on the search page? – Matthew Read Nov 25 '11 at 18:01

You must log in to answer this question.

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