Allow searches on sourcegraph.com without `repo` keyword
Created by: ijt
Currently sourcegraph.com doesn't show anything useful if you do a simple search without specifying a repo. For example, say we want to see an example of how to use "d3.selectAll"
. Currently sourcegraph.com gives this result:
It would be more useful if this search would show some examples of using this function in some popular repositories.
Here are some steps to get there:
-
Figure out how much memory we'll probably need for zoekt-webserver
by summing the sizes of all the repos, probably using http://github.com/ijt/reposize -
Run zoekt-webserver
andzoekt-sourcegraph-indexserver
on sourcegraph.com -
When zoekt-sourcegraph-indexserver
asks for the repositories to index, give it say 20k repositories at random -
Rank the repositories somehow (github stars, clone count, number of commits in other repos sharing a SHA with a commit in this repo) and index the top 20k based on that -
When a query comes in without a repo
field, search over some plausible repos instead of serving up a suggestion box.