Class: Couchbase::Cluster::SearchQuery::DocIdQuery
- Inherits:
-
Couchbase::Cluster::SearchQuery
- Object
- Couchbase::Cluster::SearchQuery
- Couchbase::Cluster::SearchQuery::DocIdQuery
- Defined in:
- lib/couchbase/search_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/search_options.rb more...
Overview
Allows to restrict matches to a set of specific documents.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(*doc_ids) {|self| ... } ⇒ DocIdQuery
constructor
A new instance of DocIdQuery.
- #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(*doc_ids) {|self| ... } ⇒ DocIdQuery
Returns a new instance of DocIdQuery.
232 233 234 235 236 |
# File 'lib/couchbase/search_options.rb', line 232 def initialize(*doc_ids) super() @doc_ids = doc_ids yield self if block_given? end |
Instance Attribute Details
#boost ⇒ Float
224 225 226 |
# File 'lib/couchbase/search_options.rb', line 224 def boost @boost end |
#field ⇒ String
227 228 229 |
# File 'lib/couchbase/search_options.rb', line 227 def field @field end |
Instance Method Details
#to_json(*args) ⇒ String
239 240 241 242 243 244 |
# File 'lib/couchbase/search_options.rb', line 239 def to_json(*args) data = {"doc_ids" => @doc_ids.flatten.uniq} data["boost"] = boost if boost data["field"] = field if field data.to_json(*args) end |