Class: Couchbase::SearchQuery::BooleanFieldQuery

Inherits:
SearchQuery
  • Object
show all
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

Constructor Details

#initialize(value) {|self| ... } ⇒ BooleanFieldQuery

Returns a new instance of BooleanFieldQuery.

Parameters:

  • value (Boolean)

Yield Parameters:



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

Returns:

  • (Float)


327
328
329
# File 'lib/couchbase/search_options.rb', line 327

def boost
  @boost
end

#field ⇒ String

Returns:

  • (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>

Returns:



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