4

How to get github search results sorted by the number of forks or stars?

I need this feature to demonstrate which project is the hottest among those that target the similar task/function/feature.

I notice github do offer the advanced search here, but how to write the query? Say, I wonder the top 10 forked django plugin apps. What the query looks like? I tried "django- fork:" or even "django- fork:>500", it doesn't work. (here we use 'django-' since most django plugin apps has such prefix)

Nakilon
  • 34,866
  • 14
  • 107
  • 142
hushwings
  • 151
  • 2
  • 8

2 Answers2

3

Update of the Update (February 2013, source "Sortable Stars"):

Starting today you can sort your starred repositories by when you starred them or when the repositories were last updated.

enter image description here

So the sort criteria is now visible.


Update January 2013 (source: "A whole new code search")

Searching by number of forks seems now to return a result ordered by number of forks

django- forks:>500

This is confirmed by the blog post "Sorting through Search Results" (January 31, 2013):

If you're searching through repositories, you can sort by stars, forks, or recently-updated


(Original answer: Sept. 2012)

I don't see any sort option in GitHub advanced search.

The forks: filter is to indicate a precise number of fork, like this query would display the 4 repos with 100 forks for "django-". But that doesn't display all repo above 100 forks, and that doesn't sort them.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Yes, I found the github only support "Exact search". In your case, is it possible to search the repo with the number of forks > 100? – hushwings Sep 03 '12 at 04:24
  • @hushwings at first glance, it doesn't seem to be possible – VonC Sep 03 '12 at 04:39
  • if github cannot support "<" ">" predicate, I think the prefix search is almost useless. How could you count on the user know the exact repo #forks(:forks), #followers(:followsers), and even size(:size). So disappointed! – hushwings Sep 03 '12 at 06:05
0

GitHub supports the "Lucene query syntax".

See @VonC's answer here:

GitHub advanced search default behaviour

and

http://www.lucenetutorial.com/lucene-query-syntax.html

But Lucene doesn't support ordering.

Community
  • 1
  • 1
jaltek
  • 2,402
  • 1
  • 23
  • 16