Class: Sunspot::Query::DateFieldFacet

Inherits:
AbstractFieldFacet show all
Defined in:
lib/sunspot/query/date_field_facet.rb

Instance Method Summary collapse

Methods inherited from AbstractFieldFacet

#initialize

Constructor Details

This class inherits a constructor from Sunspot::Query::AbstractFieldFacet

Instance Method Details

#to_paramsObject



4
5
6
7
8
9
10
11
# File 'lib/sunspot/query/date_field_facet.rb', line 4

def to_params
  params = super
  params[:"facet.date"] = [@field.indexed_name]
  params[qualified_param('date.start')] = @field.to_indexed(@options[:time_range].first)
  params[qualified_param('date.end')] = @field.to_indexed(@options[:time_range].last)
  params[qualified_param('date.gap')] = "+#{@options[:time_interval] || 86400}SECONDS"
  params
end