Class: Couchbase::Cluster::SearchQuery::BooleanFieldQuery

Inherits:
Couchbase::Cluster::SearchQuery show all
Defined in:
lib/couchbase/search_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/search_options.rb
more...

Overview

Allow to match ‘true`/`false` in a field mapped as boolean.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Couchbase::Cluster::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.

Parameters:

  • value (Boolean)

Yield Parameters:

[View source]

277
278
279
280
281
# File 'lib/couchbase/search_options.rb', line 277

def initialize(value)
  super()
  @value = value
  yield self if block_given?
end

Instance Attribute Details

#boostFloat

Returns:

  • (Float)

269
270
271
# File 'lib/couchbase/search_options.rb', line 269

def boost
  @boost
end

#fieldString

Returns:

  • (String)

272
273
274
# File 'lib/couchbase/search_options.rb', line 272

def field
  @field
end

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:

[View source]

284
285
286
287
288
289
# File 'lib/couchbase/search_options.rb', line 284

def to_h
  data = {:bool => @value}
  data[:boost] = boost if boost
  data[:field] = field if field
  data
end