Class: Stretchy::Filters::ExistsFilter
- Defined in:
- lib/stretchy/filters/exists_filter.rb
Constant Summary
Constants included from Utils::Contract
Utils::Contract::ASSERTIONS, Utils::Contract::DECAY_FUNCTIONS, Utils::Contract::DISTANCE_FORMAT
Instance Method Summary collapse
-
#initialize(field) ⇒ ExistsFilter
constructor
CAUTION: this will match empty strings see www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-filter.html.
- #to_search ⇒ Object
Methods included from Utils::Contract
included, #require_one, #validate!
Constructor Details
#initialize(field) ⇒ ExistsFilter
CAUTION: this will match empty strings see www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-filter.html
11 12 13 14 |
# File 'lib/stretchy/filters/exists_filter.rb', line 11 def initialize(field) @field = field validate! end |
Instance Method Details
#to_search ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/stretchy/filters/exists_filter.rb', line 16 def to_search { exists: { field: @field } } end |