Class: Elasticquery::Query
- Inherits:
-
Object
- Object
- Elasticquery::Query
- Defined in:
- lib/elasticquery/query.rb
Constant Summary collapse
- DEFAULT =
{query: {filtered: {query: {match_all:{}}}}}
Instance Attribute Summary collapse
-
#filters ⇒ Object
readonly
Returns the value of attribute filters.
-
#queries ⇒ Object
readonly
Returns the value of attribute queries.
Instance Method Summary collapse
-
#initialize(query = DEFAULT) ⇒ Query
constructor
A new instance of Query.
- #push_filter(filter) ⇒ Object
- #push_query(query) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
Instance Attribute Details
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
4 5 6 |
# File 'lib/elasticquery/query.rb', line 4 def filters @filters end |
#queries ⇒ Object (readonly)
Returns the value of attribute queries.
4 5 6 |
# File 'lib/elasticquery/query.rb', line 4 def queries @queries end |
Instance Method Details
#push_filter(filter) ⇒ Object
17 18 19 20 |
# File 'lib/elasticquery/query.rb', line 17 def push_filter(filter) @filters << filter merge_filter filter end |
#push_query(query) ⇒ Object
22 23 24 25 |
# File 'lib/elasticquery/query.rb', line 22 def push_query(query) @queries << query merge_query query end |
#to_hash ⇒ Object
13 14 15 |
# File 'lib/elasticquery/query.rb', line 13 def to_hash @query end |