Class: Sunspot::Query::DateFieldFacet

Inherits:
FieldFacet
  • Object
show all
Defined in:
lib/sunspot/query/field_facet.rb

Overview

:nodoc:

Constant Summary collapse

ALLOWED_OTHER =
Set.new(%w(before after between none all))

Instance Method Summary collapse

Methods inherited from FieldFacet

build, #initialize

Constructor Details

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

Instance Method Details

#to_paramsObject

Convert the facet to date params.



86
87
88
89
90
91
92
93
# File 'lib/sunspot/query/field_facet.rb', line 86

def to_params
  super.merge(
    :"facet.date" => [@field.indexed_name],
    param_key('date.start') => start_time.utc.xmlschema,
    param_key('date.end') => end_time.utc.xmlschema,
    param_key('date.gap') => "+#{interval}SECONDS"
  )
end