Class: ElasticsearchQuery::Filters
- Inherits:
-
Object
- Object
- ElasticsearchQuery::Filters
- Defined in:
- lib/elasticsearch_query/filters.rb
Instance Method Summary collapse
-
#initialize(params) ⇒ Filters
constructor
A new instance of Filters.
- #to_hash ⇒ Object
Constructor Details
#initialize(params) ⇒ Filters
Returns a new instance of Filters.
3 4 5 |
# File 'lib/elasticsearch_query/filters.rb', line 3 def initialize( params ) @params = params end |
Instance Method Details
#to_hash ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/elasticsearch_query/filters.rb', line 7 def to_hash if matches.length == 1 matches.first else { bool: { must: matches } } end end |