Skip to content

Commit

Permalink
DACCESS-474 - Don't exclude worldcat url generation for lc_callnum se…
Browse files Browse the repository at this point in the history
…arches
  • Loading branch information
chrisrlc committed Jan 9, 2025
1 parent 5e62f27 commit 95441d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion blacklight-cornell/app/views/catalog/_search_more.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% unless @response.total_count < 1 && !@expanded_results.nil? %>
<% unless @response.total_count < 1 || @expanded_results.nil? %>
<div class="highlight-box search-more">
<div class="heads-up">Not finding what you want?</div>
<p class="mb-0">
Expand Down
24 changes: 6 additions & 18 deletions blacklight-cornell/lib/blacklight_cornell/cornell_catalog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,25 +139,13 @@ def index
@filters = params[:f] || []
end

@expanded_results = {}
['worldcat'].each do |key|
@expanded_results [key] = { :count => 0 , :url => '' }
end

# Expand search only under certain conditions
tmp = BentoSearch::Results.new
if !(params[:search_field] == 'lc_callnum')
if expandable_search?
# DISCOVERYACCESS-6734 - skip entire worldcat search that was intended to provide a count for worldcat results
query = ( params[:qdisplay]?params[:qdisplay] : params[:q]).gsub(/&/, '%26')
key = :worldcat
source_results = {
:count => 1,
:url => BentoSearch.get_engine(key).configuration.link + query,
}
@expanded_results = {}
@expanded_results[key.to_s] = source_results
end
if expandable_search?
query = params[:q].gsub(/&/, '%26')
source_results = { :url => BentoSearch.get_engine(:worldcat).configuration.link + query }
@expanded_results = { 'worldcat' => source_results }
else
@expanded_results = { 'worldcat' => { :url => ENV['WORLDCAT_URL'] } }
end

@controller = self
Expand Down

0 comments on commit 95441d6

Please sign in to comment.