diff --git a/app/models/search_eds.rb b/app/models/search_eds.rb index 1b5ea7ac..609d86d3 100644 --- a/app/models/search_eds.rb +++ b/app/models/search_eds.rb @@ -46,9 +46,13 @@ def search_url(term, facets, page, per_page) end def search_filtered(term, facets, page, per_page) + Rails.logger.debug( + "EDS Search URL: #{search_url(term, facets, page, per_page)}" + ) result = HTTP.headers(accept: 'application/json', 'x-authenticationToken': @auth_token, 'x-sessionToken': @session_key) + .timeout(:global, write: 2, connect: 2, read: 2) .get(search_url(term, facets, page, per_page).to_s).to_s JSON.parse(result) end diff --git a/app/views/search/_trigger_search.html.erb b/app/views/search/_trigger_search.html.erb index 6a07bd41..266dbc99 100644 --- a/app/views/search/_trigger_search.html.erb +++ b/app/views/search/_trigger_search.html.erb @@ -1,4 +1,11 @@ -$('#<%= id %>').load("/search/search_boxed?q=<%= URI.encode_www_form_component(params[:q]) %>&target=<%= target %>", function() { +$.ajax({ + url: "/search/search_boxed?q=<%= URI.encode_www_form_component(params[:q]) %>&target=<%= target %>", + context: $('#<%= id %>') +}).done(function( msg ) { + $('#<%= id %>').html( msg ); TrackLinks( $( this ).find( 'a' ) ); ReportSummary( '<%= target %>', $( this ).find('[data-count]').data('count') ); +}).fail(function( xhr, textStatus ) { + console.log(xhr); + $('#<%= id %>').html( 'Sorry, an error has occurred loading results at this time.' ).addClass('alert error'); }); diff --git a/config/environments/development.rb b/config/environments/development.rb index e64889cd..ba857977 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -45,6 +45,13 @@ # Suppress logger output for asset requests. config.assets.quiet = true + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + # Raises error for missing translations # config.action_view.raise_on_missing_translations = true diff --git a/config/initializers/rollbar.rb b/config/initializers/rollbar.rb index 6b0265ce..54cfd149 100644 --- a/config/initializers/rollbar.rb +++ b/config/initializers/rollbar.rb @@ -5,7 +5,7 @@ config.access_token = ENV['ROLLBAR_ACCESS_TOKEN'] # Here we'll disable in 'test': - if Rails.env.test? + if Rails.env.test? || Rails.env.development? config.enabled = false end