1

Rebasing minScore depending on number of keywords, fixing bugs

This commit is contained in:
Alex Yatskov 2014-09-15 17:31:41 +09:00
parent 0a552504f4
commit a7fc6c1762
3 changed files with 7 additions and 4 deletions

View File

@ -48,7 +48,10 @@
outputResults(results.items, params.maxResults); outputResults(results.items, params.maxResults);
if (params.keywords) {
$('#query').text(params.keywords.join(', ')); $('#query').text(params.keywords.join(', '));
}
$('#useLocalScale').click(function() { $('#useLocalScale').click(function() {
var useLocalScale = $('#useLocalScale').is(':checked'); var useLocalScale = $('#useLocalScale').is(':checked');
ctx.grapher.setUseLocalScale(useLocalScale); ctx.grapher.setUseLocalScale(useLocalScale);

View File

@ -27,7 +27,7 @@
<div class="form-group"> <div class="form-group">
<label for="minScore" class="col-md-2 control-label">Minimum score</label> <label for="minScore" class="col-md-2 control-label">Minimum score</label>
<div class="col-md-10"> <div class="col-md-10">
<input class="form-control" type="number" step="any" value="1.0" id="minScore" name="minScore"> <input class="form-control" type="number" step="any" value="0.25" id="minScore" name="minScore">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

View File

@ -138,7 +138,7 @@ module.exports.execQuery = function(query) {
var searchResults = findData( var searchResults = findData(
query.searchParams, query.searchParams,
query.minScore, query.minScore * _.keys(query.searchParams).length,
query.maxResults query.maxResults
); );
@ -146,7 +146,7 @@ module.exports.execQuery = function(query) {
for (var keyword in query.searchParams) { for (var keyword in query.searchParams) {
var searchHints = searchBuildHints( var searchHints = searchBuildHints(
query.searchParams, query.searchParams,
query.minScore, query.minScore * _.keys(query.searchParams).length,
keyword, keyword,
query.searchRange, query.searchRange,
query.hintSteps query.hintSteps