Class: Skala::Adapter::Search::Request::Facet

Inherits:
Object
  • Object
show all
Defined in:
lib/skala/adapter/search/request/facet.rb

Class Method Summary collapse

Class Method Details

.factory(options) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/skala/adapter/search/request/facet.rb', line 20

def self.factory(options)
  if (options[:type] || options["type"]) == "histogram"
    parent::HistogramFacet.new(options)
  elsif (options[:type] || options["type"]) == "range"
    parent::RangeFacet.new(options)
  elsif (options[:type] || options["type"]) == "terms"
    parent::TermsFacet.new(options)
  end
end