lib/elastic_engine/search/params.rb
# Initial building for faceted search. This will apply given filters based on params passed to the search engine
# {facets_klass}        ~ Facet Config Class (from README ex: "PersonFacet")
#
Initial building for faceted search. This will apply given filters based on params passed to the search engine
{facets_klass}        ~ Facet Config Class (from README ex: "PersonFacet")
Initial building for faceted search . This will apply given filters based on params passed to the search engine { facets_klass } ~ Facet Config Class ( from README ex : " PersonFacet " )
def build_search_facet_filters(facets_klass)
        facets_klass.facets.each do |facet_key,facet_config|
          values = fetch_params_for(facet_key)
          next if values.blank? 
          _operator = fetch_operator_for(facet_config[:type], values)
          values = values.split(/[#{Response::FacetTerm::OPERATOR_MAPPING.values.join}]/) unless _operator.nil?
          search.filter_with_execution(
            facet_config[:field],
            values,
            :and,
            values.is_a?(Array) ? :terms : :term,
            _operator
          ) unless values.empty?
        end
      end
def build_search_facet_filters ( facets_klass ) facets_klass . facets . each do | facet_key , facet_config | values = fetch_params_for ( facet_key ) next if values . blank? _operator = fetch_operator_for ( facet_config [ :type ] , values ) values = values . split ( / [ #{ Response :: FacetTerm :: OPERATOR_MAPPING . values . join } ] / ) unless _operator . nil? search . filter_with_execution ( facet_config [ :field ] , values , :and , values . is_a? ( Array ) ? :terms : :term , _operator ) unless values . empty? end end
Initial building for faceted search.
Initial building for faceted search .
# Gather values from params #dont process blank params, can create blank pills, which is ugly UX # apply search filter for the facet
facets_klass
<not_specific>