Class: ElasticQuery::FilteredQuery
- Defined in:
- lib/elastic_query/filtered_query.rb
Overview
This class represents a filtered query.
Instance Attribute Summary collapse
-
#filter ⇒ Query
readonly
the filter.
-
#query ⇒ Query
readonly
the query.
Instance Method Summary collapse
-
#initialize(filter, query) ⇒ FilteredQuery
constructor
A new instance of FilteredQuery.
- #to_hash ⇒ Object
Constructor Details
#initialize(filter, query) ⇒ FilteredQuery
Returns a new instance of FilteredQuery.
11 12 13 14 |
# File 'lib/elastic_query/filtered_query.rb', line 11 def initialize(filter, query) @filter = filter super(query) end |
Instance Attribute Details
#filter ⇒ Query (readonly)
the filter
6 7 8 |
# File 'lib/elastic_query/filtered_query.rb', line 6 def filter @filter end |
#query ⇒ Query (readonly)
the query
6 7 8 |
# File 'lib/elastic_query/filtered_query.rb', line 6 def query @query end |
Instance Method Details
#to_hash ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/elastic_query/filtered_query.rb', line 16 def to_hash { filtered: { query: query.to_hash, filter: filter.to_hash } } end |