diff --git a/app/assets/javascripts/components/query_options/query_options_controller.js b/app/assets/javascripts/components/query_options/query_options_controller.js index 72caf0632..b9f24b4e9 100644 --- a/app/assets/javascripts/components/query_options/query_options_controller.js +++ b/app/assets/javascripts/components/query_options/query_options_controller.js @@ -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; @@ -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.'; }); diff --git a/app/assets/javascripts/factories/ScorerFactory.js b/app/assets/javascripts/factories/ScorerFactory.js index 9c75015c8..8c9aeed15 100644 --- a/app/assets/javascripts/factories/ScorerFactory.js +++ b/app/assets/javascripts/factories/ScorerFactory.js @@ -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 @@ -581,6 +584,7 @@ d.resolve(label); return d.promise; } + **/ var maxScore = self.maxScore(); return self.runCode(