Class: Elastic::Nodes::Range

Inherits:
Base
  • Object
show all
Includes:
Concerns::Boostable, Concerns::FieldQuery
Defined in:
lib/elastic/nodes/range.rb

Instance Attribute Summary collapse

Attributes included from Concerns::FieldQuery

#field

Attributes included from Concerns::Boostable

#boost

Instance Method Summary collapse

Methods included from Concerns::FieldQuery

#render_field

Methods inherited from Base

#==, #handle_result, #traverse

Methods included from Support::Traversable

#pick_nodes, #traverse

Instance Attribute Details

#gtObject

Returns the value of attribute gt.



6
7
8
# File 'lib/elastic/nodes/range.rb', line 6

def gt
  @gt
end

#gteObject

Returns the value of attribute gte.



6
7
8
# File 'lib/elastic/nodes/range.rb', line 6

def gte
  @gte
end

#ltObject

Returns the value of attribute lt.



6
7
8
# File 'lib/elastic/nodes/range.rb', line 6

def lt
  @lt
end

#lteObject

Returns the value of attribute lte.



6
7
8
# File 'lib/elastic/nodes/range.rb', line 6

def lte
  @lte
end

Instance Method Details

#cloneObject



8
9
10
# File 'lib/elastic/nodes/range.rb', line 8

def clone
  prepare_clone(super)
end

#render(_options = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/elastic/nodes/range.rb', line 16

def render(_options = {})
  hash = {}
  hash['gte'] = @gte unless @gte.nil?
  hash['gt'] = @gt unless @gt.nil?
  hash['lte'] = @lte unless @lte.nil?
  hash['lt'] = @lt unless @lt.nil?

  { "range" => { render_field(_options) => render_boost(hash) } }
end

#simplifyObject



12
13
14
# File 'lib/elastic/nodes/range.rb', line 12

def simplify
  prepare_clone(super)
end