This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from duke-libraries/bq-subject-search
Boost English subject queries
- Loading branch information
Showing
4 changed files
with
73 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module EnglishSubjectsBoost | ||
extend ActiveSupport::Concern | ||
|
||
# A hack to deal with the fact that | ||
# non-Roman subjects like to come up first | ||
# since linked fields often duplicate English | ||
# language subjects. | ||
def english_subjects_boost(solr_parameters) | ||
return unless includes_subject_search? | ||
solr_parameters[:bq] = 'language_f:English^10000' | ||
end | ||
|
||
private | ||
|
||
def includes_subject_search? | ||
blacklight_params.key?('search_field') && | ||
(blacklight_params['search_field'] == 'subject' || | ||
(blacklight_params['search_field'] == 'advanced' && | ||
blacklight_params.fetch('subject', nil).present?)) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module DulArgonSkin | ||
VERSION = '1.0.0' | ||
VERSION = '1.0.1' | ||
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