Advanced search not working correctly when using 'extension' filter and extra filters

I am doing a search across all the public repositories in cs files. I used the extension:cs filter. I get over 5000 results back. So far so good. Once I start using more filters, I always get 0 results back.

So if I want to get repos with more than 10 stars, I use > 10, I get 0 results back. Even using 0 or 0…100, I get 0 results back.

How can I limit the results by number of stars? Why is the stars option not working correctly?

Hi @abukres Welcome! Not sure what went on at the moment you executed your search but I haven’t been able to repro the error. When searching:>10+extension%3Acs+comments%3A>10&type=Repositories&ref=advsearch&l=&l=

I get:
Showing 939,414 available repository results

Would you give it a go and see if it works as expected now?

GitHub has different search qualifiers depending on what type of object you’re ultimately searching for. If you want a list of repositories, then you can use the repository search qualifiers. If you want a list of files or code, then you can use the file search qualifiers. Some of the search qualifiers like language are common to multiple object types.

So if you want a list of repositories that have greater than 10 stars and contain CSharp code, you can use this query language:csharp stars:>10 with type Repository.

I hope that helps!

Sorry I missed saying that I am searching for code across all the repositories.

I want to search for all cs files that have the word ‘GetWebPageAsync’ and are in repos that have 10 stars or more.

Please see my reply to andreagriffiths11.

If you want to search for all CSharp files that contain the word GetWebPageAsync in repositories that have 10 stars or more then there isn’t a single query you can run to get that result. You’ll either have to:

  • Manually search for all repositories that have 10 or more stars and then search within each of those for the CSharp files you care about
  • Write a script that will execute a search to collect all repositories with 10 or more stars, then execute a search within each of those repositories and return you the results

I hope that helps!

Thanks for the reply.

So why then this is not reflected in the UI for advanced search? I get 5,390 code results for DownloadStringTaskAsync for C#. Once I add any other filters, which the UI lets me do BTW, I always get then 0 results. This is confusing.

If the search can’t handle it then don’t the user be able to enter more filters.

You’re correct, it is confusing. Unfortunately, the hardest thing to do in search is to try to figure out what the user actually wants from what text they enter, so there are edge cases where our system doesn’t work ideally. In any case, I hope that you’re able to find the information you want using one of the techniques I described above.

This is not an edge case. This is advanced search. I entered a search term and the UI provides options for me for the different filters.

It’s right there in Github’s advanced search. As I choose a filter and enter a value for it, it’s adding the filter and value in real time in the search box. If I type > 10 for ‘With this many stars’ filter, it’s adding stars:"> 10" in the search box right there!

I guess advanced search is not advanced enough. Anyway, I will use the tips you suggested. Thanks.

Please forward this enhancement request to the dev team.