Skip to content

Commit

Permalink
143 - enable the user to search for child metadata in the parent's UV
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaLMoore committed Sep 12, 2022
1 parent 560d7b0 commit 67467e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 10 additions & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,16 @@ def iiif_search
iiif_search_response = BlacklightIiifSearch::IiifSearchResponse.new(@response,
@parent_document,
self)
render json: iiif_search_response.annotation_list,
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
1 change: 0 additions & 1 deletion app/models/iiif_search_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def show_works_or_works_that_contain_files(solr_parameters)
def ocr_search_params(solr_parameters = {})
solr_parameters[:facet] = false
solr_parameters[:hl] = true
solr_parameters[:qf] = blacklight_config.iiif_search[:full_text_field]
solr_parameters[:'hl.fl'] = blacklight_config.iiif_search[:full_text_field]
solr_parameters[:'hl.fragsize'] = 100
solr_parameters[:'hl.snippets'] = 10
Expand Down

0 comments on commit 67467e5

Please sign in to comment.