Module: PrependedLinkedData::SearchQuery

Defined in:
app/prepends/prepended_linked_data/search_query.rb

Instance Method Summary collapse

Instance Method Details

#search(query, request_header: {}, language: nil, replacements: {}, subauth: nil, context: false, performance_data: false) ⇒ String

Override Qa::Authorities::LinkedData::SearchQuery#search method

Returns:

  • (String)

    json results for search query



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/prepends/prepended_linked_data/search_query.rb', line 5

def search(query, request_header: {}, language: nil, replacements: {}, subauth: nil, context: false, performance_data: false) # rubocop:disable Metrics/ParameterLists
  return super if QaServer.config.suppress_performance_gathering?
  request_header = setup_search(request_header: request_header, language: language, replacements: replacements, subauth: subauth,
                                context: context, performance_data: performance_data)
  @phid = QaServer.config.performance_cache.new_entry(authority: authority_name, action: 'search')
  begin
    full_results = super
    update_performance_history_record(full_results)
  rescue Exception => e # rubocop:disable Lint/RescueException
    QaServer.config.performance_cache.destroy(@phid)
    raise e
  end
  requested_results(full_results)
end