-
Committer:
Tarmac
-
Author(s):
Brad Crittenden
-
Date:
2014-03-12 21:10:53 UTC
-
mfrom:
(489.1.6 1287977)
-
Revision ID:
tarmac-20140312211053-6ncl536f5u2kj4er
Filter charmworld searches by score.
This change introduces a new parameter to the API search called 'min_score'.
It defaults to a value of 1.0. Searches will be filtered and only those
results with a score above min_score will be returned.
The min_score will not be used if the search is for all bundles or charms.
In addition, the number of results will be limited the smaller of 20 or the
limit provided. Again, the limit is not applied if the search is for all
charms or bundles.
QA:
% bin/ingest --limit=20
% make run
In another window, interactively poke at it, e.g.
% http GET "http://127.0.0.1:2464/api/3/search?text=mysql&min_score=0"
% http GET "http://127.0.0.1:2464/api/3/search?text=mysql&min_score=2"
% http GET "http://127.0.0.1:2464/api/3/search?text=charmworld&min_score=0"
https://codereview.appspot.com/74900043/
R=benji. Fixes: https://bugs.launchpad.net/bugs/1287977.
Approved by Juju Gui Bot.