Skip to content

Commit

Permalink
Merge pull request #5924 from avalonmediasystem/bookmark_fix
Browse files Browse the repository at this point in the history
Skip transcript search in bookmark context
  • Loading branch information
masaball authored Jul 12, 2024
2 parents 4eb67b4 + c9733aa commit cec7551
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/search_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def add_access_controls_to_solr_params(solr_parameters)
end

def search_section_transcripts(solr_parameters)
return unless solr_parameters[:q].present? && SupplementalFile.with_tag('transcript').any?
return unless solr_parameters[:q].present? && SupplementalFile.with_tag('transcript').any? && !(blacklight_params[:controller] == 'bookmarks')

terms = solr_parameters[:q].split
term_subquery = terms.map { |term| "transcript_tsim:#{RSolr.solr_escape(term)}" }.join(" OR ")
Expand All @@ -57,7 +57,7 @@ def search_section_transcripts(solr_parameters)
end

def term_frequency_counts(solr_parameters)
return unless solr_parameters[:q].present?
return unless solr_parameters[:q].present? && !(blacklight_params[:controller] == 'bookmarks')
# Any search or filtering using a `q` parameter when transcripts are not present fails because
# the transcript_tsim field does not get created. We need to only add the transcript searching
# when transcripts are present.
Expand Down

0 comments on commit cec7551

Please sign in to comment.