Stack Overflow search engine has gone through numerous improvements over the years and in effect is quite useful. Its sorting and filtering capabilities are outstanding but when it comes to fulltext search Google still has the upper hand.

For example, a Python-related native search for


returns no matches.

In contrast, Google does a lot better and comes up with 22 hits for

getpreferredencoding site:stackoverflow.com

To get at least somewhat similar results with native search (currently 19 hits) one has to be a lot wordier and use something along the lines of


It seems that Google is smarter in defining word boundaries, especially when it comes to source code.

Would it be possible (and reasonable) to upgrade SO search to include common code punctuation as word delimiters?

PS. This isn't about beating Google but rather having a more accurate native search.


2 Answers 2


Possible? Yes.

Reasonable? Probably not. They've already farmed the searching off to Lucene.NET, so it's likely going to depend on what Lucene.NET is able to do. However, I'm not really familiar with Lucene.NET, so I absolutely can't say.

Also, keep in mind, Google is in the business of finding stuff (that they can serve ads on) and SEI is in the business of getting you to ask and answer questions. Jeff has said many times before that he wants Google to be your entry point to the stacks, and I know that right now that is the focus.

  • I don't fully understand the backend -- I'm sure others here could weigh in -- , but I think that this could simply be an issue of selecting a different spell checker? In order to allow such queries to display alternatives which match on partial strings, like the nGramDistance class.
    – M. Tibbits
    Commented Aug 3, 2011 at 1:10
  • 1
    @jcolebrand: Well.. I don't think hardly anyone expects Stack Overflow to beat Google in their own game. But that's no reason for shying away from raising the accuracy of native search which is under constant improvement anyway. See SO Search – Now 51% Less Crappy, SO Search – Now 61% Less Crappy, SO Search — Now 81% Less Crappy
    – user151803
    Commented Aug 3, 2011 at 17:48
  • 1
    Very true. I like that you've obviously researched this Saul ;)
    – jcolebrand
    Commented Aug 3, 2011 at 19:06

I had a think about this and support this with a few caveats.

If we always split on ,[(;. and so on we may actually hurt the search results.

For example: "asp.net" is a tag ... we do not want to split that particular word cause it could cause us to get lower quality asp.net search results and flood the results with "net" and "asp" results.

If we can figure out how to amend the search algorithm so it does not split tags but does split the rest, I think this could work.

You must log in to answer this question.