Readit News logoReadit News
colin353 commented on GitHub's New Code Search Is Bad for Finding Code   stackdiary.com/githubs-ne... · Posted by u/skilled
samwillis · 2 years ago
I really don't like the tone of this post, particularly calling out a named employee for, as far as I can see, a perfectly fine response. It seems to me that the OP is the one who has taken an antagonistic tone on the feedback threads, even when GitHub are showing themselves as responsive to the feedback.

Go ahead and criticise a product, but don't call out an employee or make out that they are failing to fulfil your personal requirements.

I'm sure this is only a first version of the new GitHub search, and more features will come. Give them the benefit of the doubt.

I don't really understand why we are seeing more and more of these style of antagonistic blog posts (or comments here on HN).

colin353 · 2 years ago
Colin here (I'm the "named employee"). I don't mind being called out, FWIW. I'm proud of what we built.

We would definitely have implemented sorting by recency if it was trivial to implement. But as I said before, our data shows that it is infrequently used, and to scale our search index, we designed it in a way that makes this kind of sorting tricky.

Sometimes to ship products like this, tradeoffs have to be made, and I continue to think we made the right one. Nevertheless, it's good for me and the team to hear feedback like this so we can continue to improve the product.

colin353 commented on GitHub code search is generally available   github.blog/2023-05-08-gi... · Posted by u/todsacerdoti
catchmeifyoucan · 2 years ago
Loving the new Code Search! Might be super specific, but is there any syntax for searching attributes in HTML elements. For example if a React Component called <Button ...some-props color="red" /> what's the best way to find all the buttons that are red?
colin353 · 2 years ago
Hmm, you can construct a regular expression, something like:

    lang:tsx /<Button[^\\].\* color="red"/
Example:

https://github.com/search?q=lang%3Atsx+%2F%3CButton%5B%5E%5C...

colin353 commented on GitHub code search is generally available   github.blog/2023-05-08-gi... · Posted by u/todsacerdoti
fallat · 2 years ago
Same experience here. Are there advertisement accounts posting here or something? Legitimately weird.
colin353 · 2 years ago
Ah, you need to log in to get access to the new code search!
colin353 commented on GitHub code search is generally available   github.blog/2023-05-08-gi... · Posted by u/todsacerdoti
lexh · 2 years ago
Will this make it to GH enterprise eventually?
colin353 · 2 years ago
Yes, we're working on bringing it to GitHub enterprise right now.
colin353 commented on GitHub code search is generally available   github.blog/2023-05-08-gi... · Posted by u/todsacerdoti
jhgg · 2 years ago
It would be really awesome if code search could one day consume LSIF for precise results in its index similar to source graph. The symbol search is good now, but approximate. Having more precise code search by allowing devs to upload LSIF data in their CI pipelines would allow for precise symbol search (go to definition / find usages actually being accurate) and remove irrelevant result.
colin353 · 2 years ago
Great point. Yes, we initially focused on zero-config approximate code navigation. But we do intend to support build-based code navigation in the future, since the approximate code navigation experience can be pretty poor for some languages (e.g. C/C++).
colin353 commented on GitHub code search is generally available   github.blog/2023-05-08-gi... · Posted by u/todsacerdoti
colin353 · 2 years ago
I'm Colin from GitHub's code search team, happy to answer any questions.

For more info on how we built this, you can check out our technical blog post from a few months ago https://github.blog/2023-02-06-the-technology-behind-githubs...

colin353 commented on The technology behind GitHub’s new code search   github.blog/2023-02-06-th... · Posted by u/joshbetz
Manfred · 3 years ago
Have you considered using an index directly on language tokens (eg. the abstract language tree representing the file) instead of ngrams on the source text?
colin353 · 3 years ago
We have not done this yet, but we do intend to.

Actually, our search engine is so fast that syntax highlighting the search results is often slower than finding them... so if we store the language tokens directly in the index, we'll be able to directly emit syntax highlighted snippets and make it even faster.

It may also enable some interesting search capabilities in the future, like searching within comments or by code structure.

colin353 commented on The technology behind GitHub’s new code search   github.blog/2023-02-06-th... · Posted by u/joshbetz
Royaljj · 3 years ago
Hi Colin, I’m curious as to how you search repeated letters through ngram index? I understand the example search with the string “limits” (find intersection of “lim”, “imi”, “mit” and “its”). However, if the user wants to search the string “aaaaa” how would you go about searching that?
colin353 · 3 years ago
Good question. We still construct ngrams for it, exactly the same way. So for example, we might extract `aaa`, `aaa`, and `aaa`. Or we may extract `aaaa` and `aaaa`, or perhaps `aaaaa`. Then we deduplicate to find the unique ngrams and look them up in the index.

So it's possible that a document containing `aaa` might match our ngram search, but we double check after retrieving them and exclude them from the result set.

colin353 commented on The technology behind GitHub’s new code search   github.blog/2023-02-06-th... · Posted by u/joshbetz
saagarjha · 3 years ago
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.
colin353 · 3 years ago
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!

colin353 commented on The technology behind GitHub’s new code search   github.blog/2023-02-06-th... · Posted by u/joshbetz
colin353 · 3 years ago
Hey everyone, I'm Colin from GitHub's code search team: happy to answer any questions people have about it. Also, you can sign up to get access here: https://github.com/features/code-search

u/colin353

KarmaCake day182February 16, 2010View Original