30

Google gives better search results than the built-in search

The built-in Elastic Search just can't compete with Google search results (except in one particular case, see Exception below), and people know it:

I've observed that google search (even without specifying site search, i.e. site:stackoverflow.com <search query>, gives better search results compared to SO search.

Also this,

Hands down the search feature. Sorry but it's just plain useless. Anything that's worse than a Google custom site search should be replaced by a Google custom site search.

It's one reason I hardly ever downvote duplicates: I can't blame people for not finding them most of the time. Sometimes I know the duplicate exists because I've seen it before and still can't find it.

Also this,

I agree that Stack Overflow's search tool isn't very helpful in finding relevant results. I usually just use Google with some extra search parameters like site:. For example:

"foo in the bar <some language> site:stackoverflow.com"

Narrow down your search as needed. That works for me most of the time.

Request

I think that we can significantly improve the quality of questions on Stack Overflow, and reduce the number of duplicate questions, simply by replacing the current built-in search engine with results from Google itself. I personally rarely ever use the built-in search, because Google just surfaces relevant questions so darn better.

Exception: searching for code and operators

The built-in Elastic Search will allow you to search for operators using their literal symbols, such as * and & instead of using "asterisk" and "ampersand", respectively:

Quoted phrases are exact matches except for case-sensitivity, for example, you can search for code or symbols.

Examples:

  • "COUNT(*) AS UpVotes"

  • "*="

Such a feature can help with cases where users don't know the names of particular operators. For example, => is (un?)officially known as a "hash rocket" in Ruby, but if I didn't know that, how would I search for it?

Also, "What is &:method?" is a common question to ask in the Ruby tag. Here's an example of Elastic Search surfacing a relevant question:

As far as I know (and correct me if I'm wrong), searching using literal operators isn't possible with Google. So there is that to consider if the built-in search is replaced with Google search results.

For example, if I search for "Ruby =>" on Google, these are the top results:

https://www.ruby-lang.org/
http://en.wikipedia.org/wiki/Ruby_(programming_language)
http://en.wikipedia.org/wiki/Ruby
http://rubyonrails.org/
http://ruby-doc.org/
http://www.codecademy.com/tracks/ruby
http://rubyinstaller.org/
http://rubyinstaller.org/downloads/
http://rubykoans.com/

None of those takes me directly to any relevant documentation about what the => symbol does in Ruby. However, using the query "=>" ruby with the built-in Elastic Search, the top result I get is:

Additional Resources

10
  • Alternatively, since I realize that this is probably a big change to implement, and may not be possible with Google's available APIs, other options would be to provide better instructions on how to search both Google and Elastic Search searches more effectively (like the site: operator trick for Google, and the code and operator tricks for Elastic Search).
    – user456814
    Commented May 8, 2014 at 23:43
  • Can we pre-process the search bar on Stack Overflow before generating a Google search? Commented May 9, 2014 at 5:21
  • 1
    @JonathonReinhart I'm not sure what you mean? :(
    – user456814
    Commented May 9, 2014 at 5:27
  • Sorry - I mean can we address the shortcoming that Google has regarding operators and other literal searches? Perhaps take the input from the Stack Overflow search bar, convert known symbols, etc. to Google-appropriate terms, and then forward the search on to Google? I'm not familiar with the custom search / search APIs, but it seems like it'd just be generating a URL. Commented May 9, 2014 at 5:30
  • 10
    The existing search would still need to remain for advanced search. You can't use Google to restrict the search to a specific tag, userId, views or whatever. Commented May 9, 2014 at 7:12
  • @MartinSmith I'm not sure how useful it is to restrict results to a certain tag through the built-in search. I can achieve the same thing by adding the tag keyword to a Google query, and I'll probably surface more relevant results that way. Actually, I can see how a view query would be useful for finding questions to answer though.
    – user456814
    Commented May 9, 2014 at 7:15
  • 2
    I often use the two things in conjunction and order by votes (another thing Google won't let you do). E.g. Yesterday I found a highly voted answer by Mark Byers in the MySQL tag that I was looking for without having to remember any specific phrases. Commented May 9, 2014 at 7:19
  • 2
    @MartinSmith yeah, ordering by votes is useful too. I agree with you there. It would be nice to have features of both search engines. Maybe we just need better guides for new users? Then again, maybe no one but the high-rep users bother reading them? :P
    – user456814
    Commented May 9, 2014 at 7:21
  • There's symbolhound.com for searching code (created by another SO user, sadly forgot his name) which does a way better job than google does, which just ignores most special chars. And @JonathonReinhart AFAIK there is no way to "convert symbols" to get google to actually search for them, as google doesn't want anybody to search for punctuation etc.
    – l4mpi
    Commented May 9, 2014 at 11:39
  • @l4mpi, "SymbolHound was started by David Crane and Thomas Feldtmose"
    – kdbanman
    Commented Dec 23, 2015 at 20:05

1 Answer 1

11

The fact that SO's built in search is so poor actively hurts stack overflow on so many levels.

  1. Users come to stack overflow and can not find an answer so the user is not helped which is against stack overflow's mission

  2. Users write duplicate questions. This wastes the user's time. See #1

  3. Other users answer duplicate question. This wastes the answerer's time

  4. Other users mark the question as duplicate. This wastes 1 or more people's time.

Please consider taking this suggestion more seriously. It's been 3 years since this request was posted. It would be so simple to implement. Not implementing it has probably wasted 10s of the thousands of hours of developers' time.

Note: I'm posting this because I just posted an answer for a duplicate question for which there were at least 10 duplicates. Stackoverflow's search found none of them. The questioner complained he searched and none came up, a very common complaint.

I'm sure the excuse now will be that google search is not compatible with the new channels feature but that's really still just an excuse. You could make the public site use Google and private sites not. Especially when it's only a URL away to support Google as the default search results.

It would be good to know the reasons why this hasn't been fixed. Not fixing it seems to go against everything stack overflow and fog creek have stood for over the years.

1
  • The results are still poor in 2021. Commented Oct 4, 2021 at 16:12

You must log in to answer this question.