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

Apparently "Oh, just a single tag with the NOT operator. Well, let's just silently ignore that and instead do the exact oposite of what the user wants" is considered to be a good way to handle search requests. I disagree.

Searching for a few phrases I assume will represent some of the "worst" cases in returning many questions, google estimates(1) the following number of questions for the given search phrase:

  • memory 154,000
  • list 410,000
  • error 937,000
  • int 162,000
  • java 841,000
  • single 227,000
  • object 663,000
  • help 884,000
  • input 168,000
  • C++ 287,000
  • net 1,130,000
  • connect 102,000
  • time 809,000
  • print 93,700
  • output 187,000
  • xml 213,000
  • language 900,000
  • html 378,000

Comparing this list with the top 5 tags

  • c# 133251
  • java 86234
  • php 76060
  • javascript 66577
  • .net 61605

then shows that worst case for searching for a phrase is approximately one order of magnitude worse than for tags. Is this too much? Exactly what constitutes a huge number of questions for the NOT operator I do not know, but applying the operator to more than 100,000 questions is already supported today and works fine (for instance searching for [C#] [-.net] returns 104,424 questions tagged c# not .net).

Therefore there should be no problems to apply the NOT operator on questions selected by a search phrase that returns less than 100,000 questions (e.g. "print" for instance). Quite possibly there are no problems for other search phrases returning more questions as well (any information how large a "huge" number is from someone working with the stackoverflow database?).

Question:

What are the reasons for not implementing the following algorithm

  1. User search for "phrase" [-sometag]
  2. Count number of questions with phrase
  3. If the number is greater than <HUGE_NUMBER_THRESHOLD>, abort and display an error page to user explaining the problem
  4. Apply the NOT operator
  5. Present result to user

(1)

Obviously googles estimates are just estimates. Stackoverflow currently reports 1,180,414 questions in total - which I assume to be a quite accurate number - and I doubt that there are just around 50,000 questions not containing the phrase "net", so obviously google's estimate for this is too high.

share|improve this question

You must log in to answer this question.

Browse other questions tagged .