Class: Couchbase::SearchQuery::BooleanFieldQuery
- Inherits:
-
SearchQuery
- Object
- SearchQuery
- Couchbase::SearchQuery::BooleanFieldQuery
- Defined in:
- lib/couchbase/search_options.rb,
/home/runner/work/couchbase-ruby-client/couchbase-ruby-client/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>
Constructor Details
#initialize(value) {|self| ... } ⇒ BooleanFieldQuery
Returns a new instance of BooleanFieldQuery.
335 336 337 338 339 |
# File 'lib/couchbase/search_options.rb', line 335 def initialize(value) super() @value = value yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
327 328 329 |
# File 'lib/couchbase/search_options.rb', line 327 def boost @boost end |
#field ⇒ String
330 331 332 |
# File 'lib/couchbase/search_options.rb', line 330 def field @field end |
Instance Method Details
#to_h ⇒ Hash<Symbol, #to_json>
342 343 344 345 346 347 |
# File 'lib/couchbase/search_options.rb', line 342 def to_h data = {:bool => @value} data[:boost] = boost if boost data[:field] = field if field data end |