Skip to content

Commit

Permalink
rerun scorer after changing options. runs scorer over zsr results. (#993
Browse files Browse the repository at this point in the history
)
  • Loading branch information
epugh authored Mar 28, 2024
1 parent adc0183 commit 1d069cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ angular.module('QuepidApp')
'$scope',
'$log',
'flash',
'queriesSvc',
function (
$uibModal,
$scope,
$log,
flash
flash,
queriesSvc
) {
var ctrl = this;
ctrl.query = $scope.query;
Expand Down Expand Up @@ -42,6 +44,8 @@ angular.module('QuepidApp')
ctrl.query.saveOptions(JSON.parse(value))
.then(function() {
flash.success = 'Query options saved successfully.';
$log.info('rescoring queries after changing query options');
queriesSvc.updateScores();
}, function() {
flash.error = 'Unable to save query options.';
});
Expand Down
4 changes: 4 additions & 0 deletions app/assets/javascripts/factories/ScorerFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,9 @@
function score(query, total, docs, bestDocs, options) {
bestDocs = bestDocs || [];

/**
Now allowing the scorer to be run regardless of if we have ratings or a ZSR.
The special logic for those situations is after running the scorer.
if (bestDocs.length === 0 || docs.length === 0) {
let label = null;
// Don't score if there are no ratings
Expand All @@ -581,6 +584,7 @@
d.resolve(label);
return d.promise;
}
**/

var maxScore = self.maxScore();
return self.runCode(
Expand Down

0 comments on commit 1d069cc

Please sign in to comment.