Class: ElasticsearchDslBuilder::DSL::Search::Queries::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticsearch_dsl_builder/dsl/search/query.rb

Overview

Base class for query types

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#queryObject (readonly)

Returns the value of attribute query.



8
9
10
# File 'lib/elasticsearch_dsl_builder/dsl/search/query.rb', line 8

def query
  @query
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/elasticsearch_dsl_builder/dsl/search/query.rb', line 8

def type
  @type
end

Instance Method Details

#to_hashObject



10
11
12
13
14
# File 'lib/elasticsearch_dsl_builder/dsl/search/query.rb', line 10

def to_hash
  hash = {}
  hash.update(@type => @query) if @query
  hash
end