Class: JayAPI::Elasticsearch::QueryBuilder::QueryClauses::Exists
- Inherits:
-
QueryClause
- Object
- QueryClause
- JayAPI::Elasticsearch::QueryBuilder::QueryClauses::Exists
- Defined in:
- lib/jay_api/elasticsearch/query_builder/query_clauses/exists.rb
Overview
Represents an Exists
query Documentation for this type of query can be found here: www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
Instance Method Summary collapse
-
#initialize(field:) ⇒ Exists
constructor
A new instance of Exists.
-
#to_h ⇒ Hash
The Hash representation of the Query Clause (in Elasticsearch’s format).
Constructor Details
#initialize(field:) ⇒ Exists
Returns a new instance of Exists.
16 17 18 |
# File 'lib/jay_api/elasticsearch/query_builder/query_clauses/exists.rb', line 16 def initialize(field:) @field = field end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
13 14 15 |
# File 'lib/jay_api/elasticsearch/query_builder/query_clauses/exists.rb', line 13 def field @field end |
Instance Method Details
#to_h ⇒ Hash
Returns The Hash representation of the Query Clause (in Elasticsearch’s format).
22 23 24 25 26 27 28 |
# File 'lib/jay_api/elasticsearch/query_builder/query_clauses/exists.rb', line 22 def to_h { exists: { field: field } } end |