← Back to context

Comment by obl

8 years ago

Tangentially related, but maybe microsoft could actually do that : why is github's search so terribly bad ?

If they had developed a good powerful code search (custom semantic engine for most used languages, complex queries, exact/fuzzy matches for syntax, use of history, etc) they could have become the primary way you interact with code you don't know yet.

As it stands now it's simply more efficient to clone and use plain old grep, it's really sad.

It is shockingly bad. The fact that you can't code search in a fork blows my mind. How have they not fixed this basic, important feature after so many years? What could possibly make it more difficult than a few person-months of effort?

SourceGraph tries to fix it, and the experience of searching, jump-to-definition and generally getting to grips with a codebase is way better there IMO. They also have browser plugins with integration to GitHub. I recommend you to check it out.

  • Sourcegraph is great, but I had to disable the browser plugin because it opens a new tab on every github search. So annoying.

    • Sourcegraph CEO here. There was always a toggle for that feature, but it was too hard to find. It is now off by default and you can enable it in the browser extension settings. I'm sorry you had a bad experience. I hope we get another chance to give you an awesome code search experience.

      1 reply →

Their search is really frustrating, I agree. I feel like they only index a small percentage of files, so results are always bad.

  • They don’t index forks. Cloning a fork just to search through it locally is always fun. Very annoying when a fork becomes the de facto project because it’s the one being maintained.

    • I’m not even talking forks. I’m talking largish projects hosted on GitHub (100k+ loc). The actual results will contain less than half the results you’d see with grep, and even then the indexed content may even be out of date. This is exacerbated even more when database migrations are kept in source control, with older migrations archived, and the only search results you get for eg a stored proc search will be a version of the sp from 6 months ago.

As one of my pet projects, I'm trying to resurrect Google's Code Search (a fast search indexer that supports regular expressions).

It's in alpha stage so far and lots of useful features (like multi-line search) are missing but you can already try it out for Crates.io and Hackage: https://codesearch.aelve.com. Indexing all of npmjs is coming soon.

So we're asking the creators of Bing to fix it?

  • Or whoever implemented the start menu search.

    • I used to be able to execute programs through the start menu. Can't do that anymore.

      I used to go:

      press start btn --> type "utor" --> press enter --> uTorrent.exe executes.

      Why would they remove such a useful feature?

Search seems to be surprisingly bad at a lot of companies. I don't know about github but reddits search is so bad it cannot even find something when you type it character for character.

I'm super curious to what all these companies are using for search because they are so atrocious that tend to not even work in a basic substring search solution.

  • Exactly. I can’t search my own tweets on Twitter. Facebook doesn’t know how to rank people when I do people search there. Search is terrible across the internet except Google.

I think they purposely weakened the search because people were using it to find secret keys.

  • That doesn't make sense. Ruin the feature to potentially help someone who made a mistake with security? Why wouldnt they just run the search to find keys themselves and remove them from search results.

I cannot agree more with this.

It boggles my mind why GitHub's search finds results across various commits, giving patchy results. It would be far better and likely easier for GitHub to just search HEAD. This frustrates me about GitHub every day.

  • Huh.... GitHub only searches head for me. This is confusing as I've often wanted to search other branches and can't find a way to...

Microsoft should be able to leverage Bing to do good deep searches across all code. This would be a big win for everyone (and Bing!)

Part of the reason GitHub search is so bad is to mitigate people uploading their AWS keys and passwords.