This repository has been archived by the owner on May 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
… potential matches by relevance. This fix adds; 1. An interface for the administrator to define a score threshold below which solr results will be rejected. 2. Removes potential matches that the user has not interacted with (confirmed/marked as invalid) and recreates them when a solr match is done. 3. Changed the potential matches search to return a hash of the model identifiers with their scores. 4. Returning potential match objects instead of children from Enquiry#potential_matches, in order to show the score 5. Displays the score along with the child in the summary panel of the enquiry's matches.
- Loading branch information
1 parent
0e8656d
commit bf88b73
Showing
30 changed files
with
518 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class SystemVariablesController < ApplicationController | ||
def index | ||
authorize! :read, SystemUsers | ||
@system_variables = SystemVariable.all.all | ||
end | ||
|
||
def update | ||
authorize! :update, SystemUsers | ||
params[:system_variables].keys.each do |id| | ||
variable = SystemVariable.find(id) | ||
old_value = variable.value | ||
variable.value = params[:system_variables][id] | ||
variable.save! | ||
|
||
if variable.name == SystemVariable::SCORE_THRESHOLD && variable.value != old_value | ||
Enquiry.update_all_child_matches | ||
end | ||
end | ||
|
||
redirect_to system_variables_path | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class SystemVariable < CouchRest::Model::Base | ||
use_database :system_setting | ||
|
||
property :name, String | ||
property :value, String | ||
|
||
validates :name, :presence => true, :uniqueness => true | ||
validates :value, :presence => true | ||
|
||
design do | ||
view :by_name | ||
end | ||
|
||
SCORE_THRESHOLD = 'SCORE_THRESHOLD' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.