Live data from Hacker News

The technology behind GitHub’s new code search

github.blog

61–70 of 187 posts

Re: The technology behind GitHub’s new code search

#61
Not to diminish this excellent work, but:

1) I never want to search all repos globally. At worst I want to search all of my org's repos.

2) the search UI is a little clunky, in a way I'd need to be using it again to remember.

Between those two I think there's loads of progress to be made outside of raw search power. Of course it's nice to have that, but that's what I'm really after.

Re: The technology behind GitHub’s new code search

#62
post #56

Earlier quoted context omitted.

Implementing your own index gives you more control over it. I think at this scale you probably want to tweak things specifically to your product rather than using a generic solution. I would guess that what you're indexing on (E.g. language, file, repo, etc) and sharding strategy affects the structure of your index as well.

Believe me I am aware. I am one of those who implemented their own index for a code search engine :) I did it for my own learning, but find it interesting because something like elastic with trigrams can get you very close, albeit at a far greater cost.

I'm reading your blog posts about building your own index now.

I started writing my own very simple index and search engine, but quickly decided to just use ClickHouse via https://tinybird.co as my backend (Serverless SQL with automatic APIs is pretty sweet) because I wanted to build out the product side of things and my data is really small, so I felt like it was going to be a lot of effort for little reward.

Maybe one day I will need to write a custom index or search engine that actually scales though :).

Re: The technology behind GitHub’s new code search

#63

Not to diminish this excellent work, but: 1) I never want to search all repos globally. At worst I want to search all of my org's repos. 2) the search UI is a little clunky, in a way I'd need to be using it again to remember. Between those two I think there's loads of progress to be made outside of raw search power. Of course it's nice to have that, but that's what I'm really after.

I use global search from time to time to see how other projects use certain libraries. When the documentation of said libraries is sparse this can sometimes be a good timesaver.

Re: The technology behind GitHub’s new code search

#64
I’ve been using the new code search for a couple of months and I like it, but the UI is kind of antagonistic to how I typically want to search for things. For one, the new experience doesn’t actually load code onto the page, it does some sort of lazy loading thing as you scroll around, so ⌘F doesn’t work. I understand that there’s a custom search box to try to get around this but it’s pretty slow and fiddly and I don’t really want to use it. I also find the layout to be pretty annoying, because invariably there’s a symbol panel on the side that doesn’t work for the code I want to look at, and then it’s just there taking space. If I hit “t” to enter a file name and start typing the text field loses focus after a second and I need to click on it again. I know there are a couple of people on the team in this thread: I search a lot of code on GitHub and I feel like there’s a couple of tweaks that would greatly improve my experience. Like, I think I could even show you a video of all the places where the UI has gotten less usable for me. What would be the best way to get this feedback to you? I’ve posted stuff on the forum or whatever but it’s unclear to me if this is the intended way to raise issues.

Re: The technology behind GitHub’s new code search

#65
With current search, I can search [0] the Django repo for a class that definitely exists [1] in Django, there are 0 code results. Zero. GitHub search is mystifyingly bad, I hope this is a LOT better.

[0] https://github.com/django/django/search?q=DeleteView&type=co...

[1] https://github.com/django/django/blob/main/django/views/gene...

Re: The technology behind GitHub’s new code search

#66
post #56

Earlier quoted context omitted.

Believe me I am aware. I am one of those who implemented their own index for a code search engine :) I did it for my own learning, but find it interesting because something like elastic with trigrams can get you very close, albeit at a far greater cost.

I'm reading your blog posts about building your own index now. I started writing my own very simple index and search engine, but quickly decided to just use ClickHouse via https://tinybird.co as my backend (Serverless SQL with automatic APIs is pretty sweet) because I wanted to build out the product side of things and my data is really small, so I felt like it was going to be a lot of effort for little reward. Maybe…

I won’t hijack this thread with details but if you have questions you can find my details on my profile.

Re: The technology behind GitHub’s new code search

#67
post #63

Not to diminish this excellent work, but: 1) I never want to search all repos globally. At worst I want to search all of my org's repos. 2) the search UI is a little clunky, in a way I'd need to be using it again to remember. Between those two I think there's loads of progress to be made outside of raw search power. Of course it's nice to have that, but that's what I'm really after.

I use global search from time to time to see how other projects use certain libraries. When the documentation of said libraries is sparse this can sometimes be a good timesaver.

The other big thing that works well is being able to jump directly into the source of an open source library from your code. That is powerful, but again, possibly doesn't need a giant ultra search. Just some clever linking.

Re: The technology behind GitHub’s new code search

#68
My beef with GitHub's code search is that it doesn't distinguish between the definition of a symbol and the uses of the symbol, so you need to wade through 5 pages of results to get the one result you're looking for. I would contrast that to my IDE which usually scores a direct hit if I enter a search in the right box.

The indexing they talk about in that article seems like rearranging the deck chairs on the Titanic so far as that is concerned.

Re: The technology behind GitHub’s new code search

#70

I’ve been using the new code search for a couple of months and I like it, but the UI is kind of antagonistic to how I typically want to search for things. For one, the new experience doesn’t actually load code onto the page, it does some sort of lazy loading thing as you scroll around, so ⌘F doesn’t work. I understand that there’s a custom search box to try to get around this but it’s pretty slow and fiddly and I don…

Hey saagarjha, thanks for the feedback. It's our goal to make the experience as good as possible, and we're aware of shortcomings with cmd+F and `t`, among other things. We're working on it, and your feedback helps us a lot.

We read all the feedback on the forum here: https://github.com/orgs/community/discussions/38692, so please keep providing it. Videos and screenshots are super helpful too. Thanks for bearing with us as we continue to polish the UX!

Post reply on HN