golang / gddo

Go Doc Dot Org
https://godoc.org
BSD 3-Clause "New" or "Revised" License
1.1k stars 266 forks source link

search rank algorithm where search term is a substring of the full import path #580

Open myitcv opened 5 years ago

myitcv commented 5 years ago

I had a quick search around and couldn't find any specific mentions/wiki/docs on the algorithm used when compiling and ranking search results. Apologies if this is covering old ground.

I was searching for the new go/packages (full import path is golang.org/x/tools/go/packages:

https://godoc.org/?q=go%2Fpackages

The results returned appear to be strictly ranked by number of imports, hence (for now) go/packages appears as the 31st result. This despite the fact that the search term is a substring of the import path.

Indeed I'm not entirely clear why testing appears as the first result because it appears to be entirely unrelated to go/packages.

Can someone shed some light on what's going on here?

Thanks