New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github search sucks (and how it could be better) #908

Open
RenaudWasTaken opened this Issue Mar 22, 2017 · 23 comments

Comments

Projects
None yet
@RenaudWasTaken

RenaudWasTaken commented Mar 22, 2017

Hi !

I'm reporting this as I've noticed for quite a while that github search feature is not the
feature needed by a developer.

I often find myself cloning the repository and using grep recursively or on a specific directory.
Advanced search is just plain confusing and takes too many steps to access.

Example:
1) When searching from the /src directory the search is launched on the whole repo
2) When searching for a common term only 10 results are displayed

Expected behavior:
1) The search is launched on the /src directory
2) The search displays more results with less code around the search term (see first post)

A few suggestions:

  • Enable search on specific directories from the search bar ("This repository" button)
  • Replace the search feature with a UI version of grep ?
  • Display more results and less code around search term (maybe an expand button)
  • Advanced search terms on the search result page

Thanks!

Note, Upvote this on HN: https://news.ycombinator.com/item?id=13935370 :)

@Dorian

This comment has been minimized.

Show comment
Hide comment
@Dorian

Dorian Mar 22, 2017

As an example, searching for "def create" on rails/rails: https://github.com/rails/rails/search?utf8=%E2%9C%93&q=def+create&type=

vs

git grep "def create"

screen shot 2017-03-22 at 15 13 33

Edit: Actually `"def create" works well in GitHub search now: https://github.com/rails/rails/search?utf8=%E2%9C%93&q=%22def+create%22&type=

Dorian commented Mar 22, 2017

As an example, searching for "def create" on rails/rails: https://github.com/rails/rails/search?utf8=%E2%9C%93&q=def+create&type=

vs

git grep "def create"

screen shot 2017-03-22 at 15 13 33

Edit: Actually `"def create" works well in GitHub search now: https://github.com/rails/rails/search?utf8=%E2%9C%93&q=%22def+create%22&type=

@RenaudWasTaken RenaudWasTaken changed the title from Github search sucks to Github search sucks (and how it could be better) Mar 22, 2017

@FabianKoestring

This comment has been minimized.

Show comment
Hide comment
@FabianKoestring

FabianKoestring commented Mar 22, 2017

👍

1 similar comment
@MaxymVlasov

This comment has been minimized.

Show comment
Hide comment
@MaxymVlasov

MaxymVlasov commented Mar 22, 2017

+1

@RenaudWasTaken

This comment has been minimized.

Show comment
Hide comment
@RenaudWasTaken

RenaudWasTaken Mar 22, 2017

By the way you can also upvote this on HN: https://news.ycombinator.com/item?id=13935370
This will probably help to get more visibility :)

RenaudWasTaken commented Mar 22, 2017

By the way you can also upvote this on HN: https://news.ycombinator.com/item?id=13935370
This will probably help to get more visibility :)

@davidfurlong

This comment has been minimized.

Show comment
Hide comment
@davidfurlong

davidfurlong Mar 23, 2017

Also it seems silly not to be able to search using syntax like (,).; etc - sometimes you need to be able to narrow down results drastically from 1000 to say 10 by using non alphabetic characters

davidfurlong commented Mar 23, 2017

Also it seems silly not to be able to search using syntax like (,).; etc - sometimes you need to be able to narrow down results drastically from 1000 to say 10 by using non alphabetic characters

@hbt

This comment has been minimized.

Show comment
Hide comment
@hbt

hbt commented Mar 23, 2017

@RenaudWasTaken
what about

https://github.com/rails/rails/search?utf8=%E2%9C%93&q=filepath%3Aactiverecord+%22def+create%22&type=

specify the directory in filepath: and the search term in quotes

@k1dbl4ck

This comment has been minimized.

Show comment
Hide comment
@k1dbl4ck

k1dbl4ck commented Mar 23, 2017

+1

@Dorian

This comment has been minimized.

Show comment
Hide comment

Dorian commented Mar 24, 2017

@javadba

This comment has been minimized.

Show comment
Hide comment
@javadba

javadba Mar 29, 2017

perfect title : github code search sucks. I have opened a stackoverflow issue on this. http://stackoverflow.com/questions/43096264/github-code-search-on-any-branch

javadba commented Mar 29, 2017

perfect title : github code search sucks. I have opened a stackoverflow issue on this. http://stackoverflow.com/questions/43096264/github-code-search-on-any-branch

@Mottie

This comment has been minimized.

Show comment
Hide comment
@Mottie

Mottie Apr 9, 2017

There are around 60 search filters available. Even more if you count filter negation; e.g. -user:Mottie would exclude me in your searches. So to make it easier, I created a GitHub Search Autocomplete userscript which makes these filters easier to use and even includes a few examples in a secondary dropdown.

Mottie commented Apr 9, 2017

There are around 60 search filters available. Even more if you count filter negation; e.g. -user:Mottie would exclude me in your searches. So to make it easier, I created a GitHub Search Autocomplete userscript which makes these filters easier to use and even includes a few examples in a secondary dropdown.

@leocaseiro

This comment has been minimized.

Show comment
Hide comment
@leocaseiro

leocaseiro Sep 1, 2017

I was looking for a way to search a code that starts with, for example, instead of angular2, if I search for angular, it should find angularjs, angular2, angular4 and not just angular as it's working atm.

Something like: angular* would be nice, or maybe angular% like SQL.

Perhaps this is the right issue.

leocaseiro commented Sep 1, 2017

I was looking for a way to search a code that starts with, for example, instead of angular2, if I search for angular, it should find angularjs, angular2, angular4 and not just angular as it's working atm.

Something like: angular* would be nice, or maybe angular% like SQL.

Perhaps this is the right issue.

@Mottie

This comment has been minimized.

Show comment
Hide comment
@Mottie

Mottie Sep 1, 2017

Perhaps this is the right issue.

You should use https://github.com/contact to directly contact GitHub with your request. This repo is for us to share and vent our frustrations, I don't think GitHub reads it.

Mottie commented Sep 1, 2017

Perhaps this is the right issue.

You should use https://github.com/contact to directly contact GitHub with your request. This repo is for us to share and vent our frustrations, I don't think GitHub reads it.

@Dorian

This comment has been minimized.

Show comment
Hide comment
@Dorian

Dorian Oct 8, 2017

@Mottie Github reads those comments, or at least that's what they said when I met them

Dorian commented Oct 8, 2017

@Mottie Github reads those comments, or at least that's what they said when I met them

@pakirby1

This comment has been minimized.

Show comment
Hide comment
@pakirby1

pakirby1 Oct 15, 2017

even a basic grep based search would be better.

pakirby1 commented Oct 15, 2017

even a basic grep based search would be better.

@benjamin-rood

This comment has been minimized.

Show comment
Hide comment
@benjamin-rood

benjamin-rood Jan 1, 2018

@pakirby1 It should just be a web interface for git grep in the first instance.

benjamin-rood commented Jan 1, 2018

@pakirby1 It should just be a web interface for git grep in the first instance.

@y2k-shubham

This comment has been minimized.

Show comment
Hide comment
@y2k-shubham

y2k-shubham Feb 12, 2018

Their current implementation is so pathetic that even an integrated Google Custom Search might outpass them

y2k-shubham commented Feb 12, 2018

Their current implementation is so pathetic that even an integrated Google Custom Search might outpass them

@andras-ferencz

This comment has been minimized.

Show comment
Hide comment
@andras-ferencz

andras-ferencz Mar 1, 2018

good thing they focused on adding emojis to posts before fixing their broken-by-design search bar

andras-ferencz commented Mar 1, 2018

good thing they focused on adding emojis to posts before fixing their broken-by-design search bar

@birbilis

This comment has been minimized.

Show comment
Hide comment
@birbilis

birbilis May 7, 2018

At most, search results can show two fragments from the same file, but there may be more results within the file.
https://help.github.com/articles/searching-code/

too limited...

birbilis commented May 7, 2018

At most, search results can show two fragments from the same file, but there may be more results within the file.
https://help.github.com/articles/searching-code/

too limited...

@andybak

This comment has been minimized.

Show comment
Hide comment
@andybak

andybak Aug 4, 2018

I'm finding that three quarters of the things I want to use the search for aren't supported.

And local checkout and search doesn't help with Github wide search.

Here's a biggie:

"Find all repos that contain this string" - pretty basic huh? Instead I get 1000 results for the same repo because that string occurs 1000 times.

I could go on. I find a new one every day.

andybak commented Aug 4, 2018

I'm finding that three quarters of the things I want to use the search for aren't supported.

And local checkout and search doesn't help with Github wide search.

Here's a biggie:

"Find all repos that contain this string" - pretty basic huh? Instead I get 1000 results for the same repo because that string occurs 1000 times.

I could go on. I find a new one every day.

@pakirby1

This comment has been minimized.

Show comment
Hide comment
@pakirby1

pakirby1 Aug 19, 2018

Maybe now that they have Microsoft resources they could improve the search. I’m not holding my breath....

pakirby1 commented Aug 19, 2018

Maybe now that they have Microsoft resources they could improve the search. I’m not holding my breath....

@komapa

This comment has been minimized.

Show comment
Hide comment
@komapa

komapa Sep 2, 2018

Try searching for "?callback=" and see how pathetic this search is...

komapa commented Sep 2, 2018

Try searching for "?callback=" and see how pathetic this search is...

@andras-ferencz

This comment has been minimized.

Show comment
Hide comment
@andras-ferencz

andras-ferencz Sep 4, 2018

yeah but remember folks, if you don't have an account and a bunch of free work for random projects that will be dead in a year on github.com you're not a real programmer!

andras-ferencz commented Sep 4, 2018

yeah but remember folks, if you don't have an account and a bunch of free work for random projects that will be dead in a year on github.com you're not a real programmer!

@birbilis

This comment has been minimized.

Show comment
Hide comment
@birbilis

birbilis Sep 5, 2018

One man's garbage can be another man's treasure, so sharing is caring ;-)
Problem is with a bad search you limit discovery and reuse/adaptations of code.

birbilis commented Sep 5, 2018

One man's garbage can be another man's treasure, so sharing is caring ;-)
Problem is with a bad search you limit discovery and reuse/adaptations of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment