As developers we try to not write all code by ourselves but to rather reuse existing code in the form of libraries (or “libs” for short). A key activity for code reuse is to search and find libraries that do what you need. That’s why searching through more than 200,000 libraries is one of the key features of VersionEye.
As you might have noticed, we already improved the search results on VersionEye dramatically. Currently, we are tracking almost 300K open source libraries. Many of them have similar or even the same names. Let’s assume you do a search for “hibernate”. There are more than 400 open source packages which include the string “hibernate” in their name. But which one is the one you are looking for?
Up to now, we only ranked search results by the best match for “name”. But this was often disappointing, as the results weren’t ranked the way you would think they should be ordered.
That’s why we came up with two important changes for the search. We included the number of followers and the number of references into the search algorithm. Now, when you search for “hibernate” you will see this:
As you can see there is a perfect match ranked 3rd place, a package with the name “hibernate”. The package with the name “hibernate-core” is now ranked 1st. It ranks higher because it has more followers and more references from other packages. That’s why we assume it is more important than the perfect match. And indeed this is the package you are looking for most of the time you search for “hibernate”, right?
Now, these are the search results for “spring”
All the spring submodules come first, because they have a high number of followers and references. The perfect name match only ranks on place 12.
Those two small changes to the search algorithm have improved the search already dramatically. And the good thing is, you can influence the search results by your own. Every time you follow or unfollow a package on VersionEye you influence the search results.
If you have a question or an idea about any other factor that could improve the search ranking, please let us know in the comments.
One thought on “How we improved our search results”