Class: Couchbase::Cluster::SearchQuery::BooleanFieldQuery
- Inherits:
-
Couchbase::Cluster::SearchQuery
- Object
- Couchbase::Cluster::SearchQuery
- Couchbase::Cluster::SearchQuery::BooleanFieldQuery
- 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
-
#initialize(value) {|self| ... } ⇒ BooleanFieldQuery
constructor
A new instance of BooleanFieldQuery.
- #to_json(*args) ⇒ String
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, wildcard
Constructor Details
#initialize(value) {|self| ... } ⇒ BooleanFieldQuery
Returns a new instance of BooleanFieldQuery.
268 269 270 271 272 |
# File 'lib/couchbase/search_options.rb', line 268 def initialize(value) super() @value = value yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
260 261 262 |
# File 'lib/couchbase/search_options.rb', line 260 def boost @boost end |
#field ⇒ String
263 264 265 |
# File 'lib/couchbase/search_options.rb', line 263 def field @field end |
Instance Method Details
#to_json(*args) ⇒ String
275 276 277 278 279 280 |
# File 'lib/couchbase/search_options.rb', line 275 def to_json(*args) data = {"bool" => @value} data["boost"] = boost if boost data["field"] = field if field data.to_json(*args) end |