Class: Elastic::NestedQuery

Inherits:
Object
  • Object
show all
Includes:
Dsl::BoolQueryBuilder
Defined in:
lib/elastic/nested_query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Dsl::BoolQueryBuilder

#boost, #coord_similarity, #must, #must_not, #should, #with

Constructor Details

#initialize(_index, _root = nil) ⇒ NestedQuery

Returns a new instance of NestedQuery.



7
8
9
10
# File 'lib/elastic/nested_query.rb', line 7

def initialize(_index, _root = nil)
  @index = _index
  @root = _root || build_root_node
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



5
6
7
# File 'lib/elastic/nested_query.rb', line 5

def index
  @index
end

Instance Method Details

#as_nodeObject



16
17
18
# File 'lib/elastic/nested_query.rb', line 16

def as_node
  @root.clone
end

#score_mode(_mode) ⇒ Object



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

def score_mode(_mode)
  with_clone { |root| root.score_mode = _mode }
end