Class: Qa::Authorities::LinkedData::SearchQuery
- Inherits:
-
Object
- Object
- Qa::Authorities::LinkedData::SearchQuery
- Defined in:
- lib/qa/authorities/linked_data/search_query.rb
Instance Attribute Summary collapse
-
#search_config ⇒ Object
readonly
Returns the value of attribute search_config.
Instance Method Summary collapse
-
#initialize(search_config) ⇒ SearchQuery
constructor
A new instance of SearchQuery.
-
#search(query, request_header: {}, language: nil, replacements: {}, subauth: nil, context: false, performance_data: false) ⇒ String
Search a linked data authority.
Constructor Details
#initialize(search_config) ⇒ SearchQuery
Returns a new instance of SearchQuery.
14 15 16 |
# File 'lib/qa/authorities/linked_data/search_query.rb', line 14 def initialize(search_config) @search_config = search_config end |
Instance Attribute Details
#search_config ⇒ Object (readonly)
Returns the value of attribute search_config.
18 19 20 |
# File 'lib/qa/authorities/linked_data/search_query.rb', line 18 def search_config @search_config end |
Instance Method Details
#search(query, request_header: {}, language: nil, replacements: {}, subauth: nil, context: false, performance_data: false) ⇒ String
Note:
All parameters after request_header are deprecated and will be removed in the next major release.
Search a linked data authority
37 38 39 40 41 42 43 44 45 |
# File 'lib/qa/authorities/linked_data/search_query.rb', line 37 def search(query, request_header: {}, language: nil, replacements: {}, subauth: nil, context: false, performance_data: false) # rubocop:disable Metrics/ParameterLists request_header = build_request_header(language: language, replacements: replacements, subauth: subauth, context: context, performance_data: performance_data) if request_header.empty? unpack_request_header(request_header) raise Qa::InvalidLinkedDataAuthority, "Unable to initialize linked data search sub-authority #{}" unless .nil? || () url = .build_url(action_config: search_config, action: :search, action_request: query, request_header: request_header) Rails.logger.info "QA Linked Data search url: #{url}" load_graph(url: url) normalize_results end |