-
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.
Rework
FileSetIndexer
and add text search
This commit will enable `all_text_tsimv` and `is_page_of_ssim` to be set on the FileSet. By adding `all_text_tsimv` to Solr, the OCR can be now searched through UV and any hits will be highlighted. In addition, if a parent work has any child works that have the OCR, those hits will also be indicated in the left pane via a blue magnifying glass.
- Loading branch information
Showing
6 changed files
with
32 additions
and
8 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
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,26 @@ | ||
module IiifPrint | ||
module CatalogControllerDecorator | ||
# rubocop:disable Metrics/MethodLength | ||
def iiif_search | ||
_parent_response, @parent_document = fetch(params[:solr_document_id]) | ||
iiif_search = ::BlacklightIiifSearch::IiifSearch.new(iiif_search_params, iiif_search_config, | ||
@parent_document) | ||
@response, _document_list = search_results(iiif_search.solr_params) | ||
iiif_search_response = ::BlacklightIiifSearch::IiifSearchResponse.new(@response, | ||
@parent_document, | ||
self) | ||
json_results = iiif_search_response.annotation_list | ||
json_results&.[]('resources')&.each do |result_hit| | ||
next if result_hit['resource'].present? | ||
result_hit['resource'] = { | ||
"@type": "cnt:ContentAsText", | ||
"chars": "Metadata match, see sidebar for details" | ||
} | ||
end | ||
|
||
render json: json_results, | ||
content_type: 'application/json' | ||
end | ||
end | ||
# rubocop:enable Metrics/MethodLength | ||
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