38

Is there any work going into Stack Overflow's search capabilities? The search always fails me; I always end up using DuckDuckGo or Bing to search Stack Overflow.

Lots of times when someone asks a duplicate question, repliers give him heat for not finding a similar topic. I don't think that's fair, because the search mechanism is quite poor.

For example, I was looking for replies I made with "CustomizableUI" in it. This is the answer I was trying to find and this was my search result.

This is a very common issue.

6
  • 9
    That's why it's important to have questions with good titles and tags.
    – ryanyuyu
    Sep 2, 2015 at 22:07
  • 2
    @MartijnPieters I think they intended to search their own posts ("I was looking for replies I made with [keyword] in it)". The linked answer "not found" has the string included inside a code section.
    – ryanyuyu
    Sep 2, 2015 at 22:16
  • 5
    @ryanyuyu: ah, yes, the age-old problem of stemming and literal code sections. I search using * wildcards: 7 results.
    – Martijn Pieters Mod
    Sep 2, 2015 at 22:22
  • 1
    Thanks so much @HansPassant for the backup. @ down voters this shows that stackoverflow search needs to be fixed so people dont have to rely on other engines to search the site haha.
    – Noitidart
    Sep 2, 2015 at 22:24
  • @MartijnPieters that's pretty much an answer. It includes the post the user was trying to find. The search features on SO work if you use them properly.
    – ryanyuyu
    Sep 2, 2015 at 22:27
  • 4
    In another meta post stack overflow officials explained that writing a search engine is hard and putting years of effort into becoming almost as good as google is just not worth the time and effort. Not sure if they still stand by that opinion.
    – nwp
    Sep 3, 2015 at 7:47

3 Answers 3

29

The codeword appears in a codeblock on that page. The problem with code is that it is bloody hard to stem and index properly. Try searching for && or and or other operators that consist only of symbols or common English words, for example. The major search engines all fail at this just as hard.

As such, Stack Overflow is at least trying to handle code blocks properly by not splitting on . and other punctuation, as code is not human language and punctuation has other meaning.

For your example that means CustomizableUI was never indexed; CustomizableUI.createWidget was indexed instead. Searching for that phrase leads to 4 search results including your specific post.

I tend to use a wildcard (*) when searching for code terms to account for this. Searching for CustomizableUI* produces 7 results.

Search is a hard problem, and the Stack Exchange team is aware of this. They are trying to improve search, but I for one can see the advantages of treating code differently.

12
  • Thanks Martjin! Maybe for noobs on SO we can auto fill wild cards
    – Noitidart
    Sep 3, 2015 at 11:12
  • If using wildcards works better, why isn't it the default? Sep 3, 2015 at 13:45
  • 2
    @Thomas: because you don't want to apply that to everything, as that would lead to way too many false positives.
    – Martijn Pieters Mod
    Sep 3, 2015 at 13:47
  • @MartijnPieters I hear you, man. I've fought with false positives from a "auto-fill wildcard" approach before. The problem isn't with the query, it's with the data that is indexed. Sep 3, 2015 at 16:11
  • 3
    Can't you tokenize "CustomizableUI.createWidget" as { "CustomizableUI", "createWidget", "CustomizableUI.createWidget" }? Just everything.
    – usr
    Sep 4, 2015 at 12:41
  • 3
    @usr: I don't know. Study ElasticSearch and apply for a job with Stack Exchange perhaps?
    – Martijn Pieters Mod
    Sep 4, 2015 at 12:42
  • @MartijnPieters I mistakenly assumed you worked there based on the wording of the answer.
    – usr
    Sep 4, 2015 at 12:44
  • 1
    @usr: :-) Sorry, I'm just a moderator and heavy user, my answer is based on my own observations and general software development experience.
    – Martijn Pieters Mod
    Sep 4, 2015 at 12:46
  • Given how many people were recruited from SO you never know who works there now and who doesn't.
    – usr
    Sep 4, 2015 at 12:47
  • Since the functionality's there but people fail to find it, this sounds like a UX issue. With the way Google works I think most people just assume wild cards are automatic but search results are prioritized. If wildcards definitely aren't supposed to be automatic, if a search returns less than, say, ten results, at the end of the list it could say: Not the results you're looking for? Try adding a wildcard to your search user:1828637 CustomizableUI* with the last part being clickable to start the new search.
    – Jan
    Sep 5, 2015 at 11:44
  • @Jan: that doesn't scale to multiple words and phrases though. Search is hard, and as it is Google's core business, they got to spend huge numbers of PhD graduates on such problems, Stack Exchange doesn't have such resources.
    – Martijn Pieters Mod
    Sep 5, 2015 at 12:06
  • @MartijnPieters It doesn't matter if it scales, it does two things: Possibly helps the user find what they're actually looking for. And informs the user that this is how the search works. After the user has been informed about the wildcard behaviour, they can adapt their query accordingly.
    – Jan
    Sep 5, 2015 at 12:26
20

For exmaple I was looking for replies

Yes, like that. Google returns ten million hits when you query "site:stackoverflow.com exmaple". Its ability to second-guess what you meant instead of going off in the woods searching for dead Canadian trees is something other search engines can't quite match.

So just use it.

8
  • 1
    Haha ok. I dont use google, i find duckduckgo does an equal or better job. And if ddg doesnt work for me, which is rare, then I use bing.
    – Noitidart
    Sep 2, 2015 at 22:27
  • 15
    Umm, yes, I used to wear purple pants. The washing machine killed it. Sep 2, 2015 at 22:29
  • 1
    HAHAHAHAHA man :P
    – Noitidart
    Sep 2, 2015 at 22:52
  • 6
    Heh, bing. That's still funny :P
    – Cerbrus
    Sep 3, 2015 at 7:50
  • Holy heck!! I never knew thats what bing stood for!! Thats hilarious!!!!
    – Noitidart
    Sep 3, 2015 at 11:12
  • Stack Overflow made Q&A systems better, why shouldn't someone else be able to implement a search as good as google does? Does any open source search engine implement a dictionary with synonyms, base forms and spelling mistakes? I doubt it. Sep 3, 2015 at 13:57
  • 2
    @Thomas SO was a good idea with solid execution. Google search is the result of years of of work from the world's best software engineers and computer scientists. It is the cutting edge of computer science. DDG isn't a bad search engine, by any normal standard, but Google is years ahead of it.
    – DanielST
    Sep 4, 2015 at 13:35
  • @slicedtoad Duckduckgo is coming closer and closer to it without compromising privacy ;)
    – Cloverr
    Aug 20, 2016 at 15:29
-6

Kind of a Question and Answer in one here but:

Why isn't the SO search bar Powered by Google?

2
  • 2
    As it stands now, you can choose to use Google. Or you can choose to use SO Search and find all the [foo] tags without answers. Google can't do that. What you are suggesting would remove that choice.
    – Michael
    Sep 3, 2015 at 13:06
  • 1
    @Michael can Structured Data be leveraged to take advantage of tags?
    – MonkeyZeus
    Sep 3, 2015 at 13:20

You must log in to answer this question.

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