Class: Couchbase::SearchQuery::BooleanFieldQuery
- Inherits:
-
Couchbase::SearchQuery
- Object
- Couchbase::SearchQuery
- Couchbase::SearchQuery::BooleanFieldQuery
- Defined in:
- lib/couchbase/search_options.rb
Overview
Allow to match ‘true`/`false` in a field mapped as boolean.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(value) {|self| ... } ⇒ BooleanFieldQuery
constructor
A new instance of BooleanFieldQuery.
- #to_h ⇒ Hash<Symbol, #to_json>
Methods inherited from Couchbase::SearchQuery
boolean_field, booleans, conjuncts, date_range, disjuncts, doc_id, geo_bounding_box, geo_distance, geo_polygon, match, match_all, match_none, match_phrase, numeric_range, phrase, prefix, query_string, regexp, term, term_range, #to_json, wildcard
Constructor Details
#initialize(value) {|self| ... } ⇒ BooleanFieldQuery
Returns a new instance of BooleanFieldQuery.
337 338 339 340 341 |
# File 'lib/couchbase/search_options.rb', line 337 def initialize(value) super() @value = value yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
329 330 331 |
# File 'lib/couchbase/search_options.rb', line 329 def boost @boost end |
#field ⇒ String
332 333 334 |
# File 'lib/couchbase/search_options.rb', line 332 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
344 345 346 347 348 349 |
# File 'lib/couchbase/search_options.rb', line 344 def to_h data = {:bool => @value} data[:boost] = boost if boost data[:field] = field if field data end |