Class: Skala::PrimoAdapter::Search::RequestTransformation::AddQueries

Inherits:
Transformator::Transformation::Step
  • Object
show all
Defined in:
lib/skala/primo_adapter/search/request_transformation/add_queries.rb

Instance Method Summary collapse

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/skala/primo_adapter/search/request_transformation/add_queries.rb', line 8

def call
  query_terms_node = transformation.inner_search_request.locate("PrimoSearchRequest/QueryTerms").first

  [source.queries, source.facet_queries].flatten.compact.presence.try(:each) do |_query|
    if primo_query = query_factory(_query)
      [primo_query].flatten(1).each do |_primo_query|
        query_terms_node << _primo_query
      end
    end
  end
end