Module: Boolminot::Clauses::Base::InstanceMethods
- Included in:
- Boolminot::Clauses::Base, Compounds::AtLeast, Compounds::Conjunction, Compounds::Disjunction, MatchAll, MatchNone, Negation
- Defined in:
- lib/boolminot/clauses/base.rb
Instance Method Summary collapse
- #satisfied_by?(document) ⇒ Boolean
- #to_elasticsearch(options = {}) ⇒ Object
- #to_elasticsearch_negated(options = {}) ⇒ Object
- #to_raw_bool(options = {}) ⇒ Object
Instance Method Details
#satisfied_by?(document) ⇒ Boolean
11 12 13 |
# File 'lib/boolminot/clauses/base.rb', line 11 def satisfied_by?(document) raise NoMethodError, 'Sorry; Boolminot clauses do not act as percolators' end |
#to_elasticsearch(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/boolminot/clauses/base.rb', line 15 def to_elasticsearch( = {}) = { context: :filter } = .merge() send "to_elasticsearch_in_#{[:context]}_context" end |
#to_elasticsearch_negated(options = {}) ⇒ Object
24 25 26 |
# File 'lib/boolminot/clauses/base.rb', line 24 def to_elasticsearch_negated( = {}) { bool: { must_not: [to_elasticsearch()] } } end |
#to_raw_bool(options = {}) ⇒ Object
28 29 30 |
# File 'lib/boolminot/clauses/base.rb', line 28 def to_raw_bool( = {}) { bool: { must: [to_elasticsearch()] } } end |