7

How does the search algorithm on stackoverflow work? I need to implement a search functionality in one of my web sites.

Jeff Atwood
  • 63,320
  • 48
  • 150
  • 153
Ramesh Soni
  • 15,867
  • 28
  • 93
  • 113
  • 13
    Please don't take SO as something to emulate - when it comes to searching, it is one of the worst sites I have ever used. –  Jun 04 '09 at 13:02
  • 1
    The answer is: badly. Most of the time I get better results searching SO with google. Btw this question is probably going to be closed soon. – z - Jun 04 '09 at 13:02
  • 1
    See this http://blog.stackoverflow.com/2008/10/stack-overflow-search-now-51-less-crappy/ fro the explanation of the idea. – sharptooth Jun 04 '09 at 13:05

5 Answers5

4

You should look into Full Text Search:

https://en.wikipedia.org/wiki/Full-text_search

DividedByZero
  • 4,333
  • 2
  • 19
  • 33
andreialecu
  • 3,639
  • 3
  • 28
  • 36
2

Not very well. If you need your site searchable, try adding a Google search box through Adsense (and setting up a sitemap).

chaos
  • 122,029
  • 33
  • 303
  • 309
0

SQL Server Full text search

and as stackoverflow saying:

  • You're browsing through questions matching search terms search stackoverflow
  • Search within specific tags by adding them in brackets, like [tag] or [tag-2].
  • Enclose your search in "quotes" to match a phrase.
  • You can narrow your search by using the ~ (near) and - (not) operators before words.*
Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Amr Elgarhy
  • 66,568
  • 69
  • 184
  • 301
0

I believe they use the Full Text Search capabilities of SQL Server.

Dan
  • 17,375
  • 3
  • 36
  • 39
0

Suggesting SQL Server assumes thats the db backend, better to use Lucene or if you dont want to use java there's .Net, C and Ruby ports of the lucene.

Actually i wouldn't be surprised if SO is Lucene.Net based.

Krypes
  • 561
  • 2
  • 10