Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

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

Open
RenaudWasTaken opened this issue Mar 22, 2017 · 53 comments
Open

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

RenaudWasTaken opened this issue Mar 22, 2017 · 53 comments
Labels

Comments

@RenaudWasTaken
Copy link

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 :)

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

👍

1 similar comment
@MaxymVlasov
Copy link

+1

@davidfurlong
Copy link

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
Copy link

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
Copy link

+1

@javadba
Copy link

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
Copy link

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
Copy link

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
Copy link

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.

@pakirby1
Copy link

even a basic grep based search would be better.

@benjamin-rood
Copy link

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

@y2k-shubham
Copy link

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

@plasticalligator
Copy link

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

@birbilis
Copy link

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
Copy link

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
Copy link

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

@komapa
Copy link

komapa commented Sep 2, 2018

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

@plasticalligator
Copy link

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
Copy link

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.

@L3nn0x
Copy link

L3nn0x commented Dec 12, 2018

Can we talk about Github search not finding all results? When I do a search I often get less than half the actual results and there's no way to get the other half.

@clarkbw clarkbw added the search label Dec 18, 2018
@Dave9111
Copy link

Yes, its very broken... When it can't find all of your repositories.... its junk.

@rajuashok
Copy link

Hello. Has this been looked into? Seriously github search drives me insane. I search for a filename and every mention of that name in other file shows up before that file itself. How is that the right behavior? Also entering the entire path to a file name including the extension (e.g. .tsx) fails completely. Why is including the extension not find the file name?

@birbilis
Copy link

birbilis commented May 3, 2019

Maybe it treats the dot specially? Try backslash before the dot. However I guess they only search in the contents

@plasticalligator

This comment has been minimized.

@CrackerHax
Copy link

Update: github search still sucks

Repository owner deleted a comment Jul 16, 2019
@ghost
Copy link

ghost commented Oct 22, 2019

Still sucks.

@TheSharpieOne
Copy link

TheSharpieOne commented Oct 22, 2019

Here you can see the search is able to determine that 9 results were found for the query within JavasScript files... but when clicking to narrow the search down to see just those 9 JavaScript results... nothing is found (note: the JavaScript results were in the original 59 results... just didn't want to page through them all to find them)

github-no-results

@pakirby1
Copy link

pakirby1 commented Dec 9, 2019

Search will never be fixed.

@CrackerHax
Copy link

CrackerHax commented Dec 9, 2019

They might as well link it to google search seeing as to how we end up having to use google to find anything anyway (and google isn't great for code either).

@aderchox
Copy link

aderchox commented Feb 5, 2020

GitHub please it's 2020!

Also the "Most Stars" sort doesn't work properly at all. Pharo as an instance, has 99% SmallTalk as the programming language of its repository and has 500 stars, but when searching the "language:SmallTalk", and choosing the "Most Stars" sort type, the repository that is displayed first has around 120 stars only. :|

@pakirby1
Copy link

pakirby1 commented Feb 8, 2020 via email

@pakirby1
Copy link

pakirby1 commented Feb 8, 2020 via email

@fpesari
Copy link

fpesari commented Jul 11, 2020

I was looking for software related to the NES Sound Format (NSF) and I kept getting results about NSFW, even with the double quotes...please fix this, it'd be better if it just ran plain ack or ag in many cases!

@ipince
Copy link

ipince commented Aug 28, 2020

3.5 years later, it still sucks.

@pakirby1
Copy link

pakirby1 commented Aug 28, 2020 via email

@gittymcgit
Copy link

October 2020 it still sucks

@shadinaif
Copy link

November 2020, no change

@fmudhir
Copy link

fmudhir commented Nov 18, 2020

Still sucks after all this time, can't tell you how much this affects my day-to-day..

@mu578
Copy link

mu578 commented Dec 8, 2020

Still sucks deep, even blows.

@anko
Copy link

anko commented Dec 17, 2020

I am having this mysterious issue with search. In short: When I'm logged in, I see 0 results for a search that other users see 36 results for. Other users see results, but I have to log out to see them. 💫

I've emailed Github support about it.

(Made a comment instead of a separate issue as advised by #1864 (comment).)

@TPS
Copy link
Collaborator

TPS commented Dec 19, 2020

I think https://github.blog/changelog/2020-12-17-changes-to-code-search-indexing/ is announcing a step backwards. Thoughts?

@andybak
Copy link

andybak commented Dec 19, 2020 via email

@TPS
Copy link
Collaborator

TPS commented Dec 19, 2020

If anyone's interested, please add to the 🔥 by commenting @ https://github.community/t/feedback-on-changes-to-code-search-indexing/150660. Might not hurt to mention other problems (as above) in passing.

@jeremiahmoree-adot
Copy link

I am having this mysterious issue with search. In short: When I'm logged in, I see 0 results for a search that other users see 36 results for. Other users see results, but I have to log out to see them. 💫

I've emailed Github support about it.

(Made a comment instead of a separate issue as advised by #1864 (comment).)

I get 0 results for most searches even when using a string i copied from a file in a repo. It finds the string in Issues and PRs but not in code which is where I need it to search. All our work is less than 1 year old so it shouldn't be that problem...

@motching
Copy link

motching commented May 7, 2021

can we just pipe an <input> into grep?

for heavens sake

@mdegans
Copy link

mdegans commented Jun 29, 2021

It's hilariously bad. I have a repo named libptzf and it can't find it in Youre Repositories searching for ptzf. Did i put a dash after the lib or not? I can never remember. Search should be able to help.

@Levi-Lesches
Copy link
Contributor

Reminder that this is not the official GitHub feedback repo. Open a discussion there to get GItHub's attention.

@pakirby1
Copy link

pakirby1 commented Jun 30, 2021 via email

@Levi-Lesches
Copy link
Contributor

Reminder that this is not the official GitHub feedback repo. Open a discussion there to get GItHub's attention.

You don't have to email anyone, just open a new discussion in the official repo above instead of here. GitHub is offering you a way to interact with their staff, which wasn't possible like this before, why ignore it? This repo was made because there wasn't such an option at the time. Now there is.

@pakirby1
Copy link

pakirby1 commented Jul 1, 2021 via email

@CrackerHax
Copy link

search is just completely unusable now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests