Class: Celsius::Primo::SoapApi::Searcher::SearchBrief::SearchResultTransformation::AddMissingFacets

Inherits:
Transformation::Step
  • Object
show all
Defined in:
lib/celsius/primo/soap_api/searcher/search_brief/search_result_transformation/add_missing_facets.rb

Instance Method Summary collapse

Instance Method Details

#callObject

Sometimes, requested facets do not show up in search result, so we have to (re)add them



10
11
12
13
14
15
16
17
18
# File 'lib/celsius/primo/soap_api/searcher/search_brief/search_result_transformation/add_missing_facets.rb', line 10

def call
  (search_request["facets"] || {}).each do |facet_name, requested_facet|
    unless target["facets"][facet_name]
      if requested_facet["terms"]
        target["facets"][facet_name] = empty_search_result_terms_facet
      end
    end
  end
end