Class: Sensei::RangeQuery
Instance Attribute Summary
Attributes inherited from Query
Instance Method Summary collapse
Methods inherited from Query
construct, #get_boost, #initialize, #not_query?, q, #run, #to_sensei
Methods included from Operators
#&, #*, #boost!, #must_not, #|, #~
Constructor Details
This class inherits a constructor from Sensei::Query
Instance Method Details
#to_h ⇒ Object
141 142 143 144 145 146 147 148 149 150 |
# File 'lib/sensei/query.rb', line 141 def to_h {:range => { [:field] => { :from => [:from], :to => [:to], :_type => [:type] || (([:from].is_a?(Float) || [:to].is_a?(Float)) ? "double" : "float") }.merge(get_boost).merge([:type] == :date ? {:_date_format => [:date_format] || 'YYYY-MM-DD'} : {}) }, } end |