Live data from Hacker News

Towards Natural Language Semantic Code Search at GitHub

githubengineering.com

11–20 of 55 posts

Re: Towards Natural Language Semantic Code Search at GitHub

#11
post #5

This might just be me, but does anyone else feel that GitHub's code search has other points that could be improved first? My biggest gripe is that the other results show in seems to be totally random. For example, if I have a Java class called A and I search "class A" in code search, the actual A.java doesn't tend to show up anywhere near the front. I just tried this in a repo and the actual A.java file was on the la…

Yes, GH search leaves so much to be desired. And this post doesn't actually seem to address the weaknesses.

The search appears to be configured for natural language documents, not code. The stopwords are not right and search appears to strip all sigils. They could get pretty far just by parsing documents and changing their lucene/elasticsearch configuration.

Re: Towards Natural Language Semantic Code Search at GitHub

#13
post #3

I would settle for the ability to use logical OR when searching issues/pull requests, or to combine multiple negated searches. "is:pr is:open ( author:bob OR author:jim )" The lack of this pretty basic functionality makes issue & PR search much less useful than it could be.

Agreed. It'd also be nice to see a list of issues you're subscribed to. Here's a fun issue to follow for that - https://github.com/isaacs/github/issues/283

Re: Towards Natural Language Semantic Code Search at GitHub

#14
It is a real cultural problem how engineers get more excited about machine learning than basic usability.

GitHub search can't even search for a literal string, let alone a regex. It can't search a subdirectory. Ranking is indistinguishable from random. It's been this way for years. How about building an actual, usable, basic code search and then getting all fancy with your machine learning?

I almost built my own "online git grep for GitHub" last year.

Re: Towards Natural Language Semantic Code Search at GitHub

#15

It is a real cultural problem how engineers get more excited about machine learning than basic usability. GitHub search can't even search for a literal string, let alone a regex. It can't search a subdirectory. Ranking is indistinguishable from random. It's been this way for years. How about building an actual, usable, basic code search and then getting all fancy with your machine learning? I almost built my own "onl…

Yes! When I read the post title I was really excited. The I clicked in and felt my heart sink a little. Engineers and PMs seem to be too easily swayed by shiny things.

Re: Towards Natural Language Semantic Code Search at GitHub

#16

It is a real cultural problem how engineers get more excited about machine learning than basic usability. GitHub search can't even search for a literal string, let alone a regex. It can't search a subdirectory. Ranking is indistinguishable from random. It's been this way for years. How about building an actual, usable, basic code search and then getting all fancy with your machine learning? I almost built my own "onl…

Agreed. Luckily, we as a community have tools like Sourcegraph which are based on battle-tested pragmatic systems from places like Google.

Disclaimer: no affiliation, just love the team and product.

Re: Towards Natural Language Semantic Code Search at GitHub

#17

It is a real cultural problem how engineers get more excited about machine learning than basic usability. GitHub search can't even search for a literal string, let alone a regex. It can't search a subdirectory. Ranking is indistinguishable from random. It's been this way for years. How about building an actual, usable, basic code search and then getting all fancy with your machine learning? I almost built my own "onl…

All I can say is that we know this. We know it should be better. There's definitely more to come.

Re: Towards Natural Language Semantic Code Search at GitHub

#18

It is a real cultural problem how engineers get more excited about machine learning than basic usability. GitHub search can't even search for a literal string, let alone a regex. It can't search a subdirectory. Ranking is indistinguishable from random. It's been this way for years. How about building an actual, usable, basic code search and then getting all fancy with your machine learning? I almost built my own "onl…

I agree with this sentiment 100%. I can use traditional search engines for "how to ping a rest thing in python", but I can't grep Github for even basic snippets of code. I don't think their global code search has ever been useful. Glad they have their priorities straight /s

Re: Towards Natural Language Semantic Code Search at GitHub

#19
post #5

This might just be me, but does anyone else feel that GitHub's code search has other points that could be improved first? My biggest gripe is that the other results show in seems to be totally random. For example, if I have a Java class called A and I search "class A" in code search, the actual A.java doesn't tend to show up anywhere near the front. I just tried this in a repo and the actual A.java file was on the la…

We are very aware of the problem. I think you are going to really love what we are working on.

Is it some search algorithm that is so new, unusual and groundbreaking you can't talk about until it patented, or what?

Re: Towards Natural Language Semantic Code Search at GitHub

#20
post #5

This might just be me, but does anyone else feel that GitHub's code search has other points that could be improved first? My biggest gripe is that the other results show in seems to be totally random. For example, if I have a Java class called A and I search "class A" in code search, the actual A.java doesn't tend to show up anywhere near the front. I just tried this in a repo and the actual A.java file was on the la…

We are very aware of the problem. I think you are going to really love what we are working on.

I really hope you are right and have your priorities straight when it comes to search. I'd love for a way to search for usages of a class::method, or for strings that contain the text "hello" or for variables named foo. And if you integrate that into the code itself, Ctrl+click a class method to find all usages, maybe even usages in other repositories, so I can see how other people use a certain library.

And of course good old regex search.

Post reply on HN