diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index bd7c75080..b6c8faf74 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -82,6 +82,7 @@ def self.uploaded_field config.http_method = :post ## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params + # Max fragsize is needed to not cut off full text search at default 51,000 characters config.default_solr_params = { qt: "search", rows: 10, @@ -93,7 +94,8 @@ def self.uploaded_field "hl.simple.pre": "", "hl.simple.post": "", "hl.snippets": 30, - "hl.fragsize": 100 + "hl.fragsize": 100, + "hl.maxAnalyzedChars": 5_100_000 } # Specify which field to use in the tag cloud on the homepage. diff --git a/app/helpers/shared_search_helper.rb b/app/helpers/shared_search_helper.rb index 4f3dc5d92..303c52289 100644 --- a/app/helpers/shared_search_helper.rb +++ b/app/helpers/shared_search_helper.rb @@ -63,11 +63,10 @@ def build_url(id, request_params, account_cname, base_route_name) # @param params [Hash] the query parameters, which may include search queries # @return [String] the URL with appended query parameters, if applicable def append_query_params(url, model, params) - return url if params[:q].blank? if params[:q].present? && model.any_highlighting_in_all_text_fields? "#{url}?parent_query=#{params[:q]}&highlight=true" else - "#{url}?q=#{params[:q]}" + url end end diff --git a/app/views/catalog/_index_list_default.html.erb b/app/views/catalog/_index_list_default.html.erb index dd935e223..03359fd09 100644 --- a/app/views/catalog/_index_list_default.html.erb +++ b/app/views/catalog/_index_list_default.html.erb @@ -11,7 +11,7 @@ <% if should_render_index_field?(document, field) && field_value.present? %>
<%= render_index_field_label document, field: field_name %>
-
<%= markdown(doc_presenter.field_value field) %>
+
<%= markdown(field_value) %>
<% end %> <% end %> diff --git a/spec/helpers/shared_search_helper_spec.rb b/spec/helpers/shared_search_helper_spec.rb index 651b2d9df..17127f189 100644 --- a/spec/helpers/shared_search_helper_spec.rb +++ b/spec/helpers/shared_search_helper_spec.rb @@ -28,8 +28,9 @@ it 'returns #generate_work_url with a query' do allow(params).to receive(:[]).with(:q).and_return('foo') + allow(work_hash).to receive(:any_highlighting_in_all_text_fields?).and_return(false) - url = "#{request.protocol}#{cname}/concern/generic_works/#{uuid}?q=foo" + url = "#{request.protocol}#{cname}/concern/generic_works/#{uuid}" expect(helper.generate_work_url(work_hash, request, params)).to eq(url) end @@ -50,12 +51,12 @@ expect(helper.generate_work_url(work_hash, request)).to eq(url) end - it 'returns #generate_work_url with a query' do + it 'returns #generate_work_url if given a query but no highlighting' do allow(params).to receive(:[]).with(:q).and_return('foo') + allow(work_hash).to receive(:any_highlighting_in_all_text_fields?).and_return(false) - url = "#{request.protocol}#{account.cname}:#{request.port}/concern/generic_works/#{uuid}?q=foo" + url = "#{request.protocol}#{account.cname}:#{request.port}/concern/generic_works/#{uuid}" expect(helper.generate_work_url(work_hash, request, params)).to eq(url) - allow(work_hash).to receive(:any_highlighting_in_all_text_fields?).and_return(false) end it 'returns #generate_work_url with a query and highlight true for UV' do