Class: Couchbase::Cluster::SearchQuery::DocIdQuery
Overview
Allows to restrict matches to a set of specific documents.
Instance Attribute Summary collapse
Instance Method Summary
collapse
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.
[View source]
254
255
256
257
258
|
# File 'lib/couchbase/search_options.rb', line 254
def initialize(*doc_ids)
super()
@doc_ids = doc_ids
yield self if block_given?
end
|
Instance Attribute Details
#boost ⇒ Float
243
244
245
|
# File 'lib/couchbase/search_options.rb', line 243
def boost
@boost
end
|
#field ⇒ String
249
250
251
|
# File 'lib/couchbase/search_options.rb', line 249
def field
@field
end
|
#operator ⇒ nil, ...
246
247
248
|
# File 'lib/couchbase/search_options.rb', line 246
def operator
@operator
end
|
Instance Method Details
#to_json(*args) ⇒ String
[View source]
261
262
263
264
265
266
267
|
# File 'lib/couchbase/search_options.rb', line 261
def to_json(*args)
data = {"doc_ids" => @doc_ids.flatten.uniq}
data["boost"] = boost if boost
data["operator"] = operator.to_s if operator
data["field"] = field if field
data.to_json(*args)
end
|