Class: Couchbase::SearchQuery::DocIdQuery

Inherits:
SearchQuery
  • Object
show all
Defined in:
lib/couchbase/search_options.rb

Overview

Allows to restrict matches to a set of specific documents.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*doc_ids) {|self| ... } ⇒ DocIdQuery

Returns a new instance of DocIdQuery.

Parameters:

  • doc_ids (String...)

Yield Parameters:



304
305
306
307
308
# File 'lib/couchbase/search_options.rb', line 304

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

Instance Attribute Details

#boostFloat

Returns:

  • (Float)


299
300
301
# File 'lib/couchbase/search_options.rb', line 299

def boost
  @boost
end

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:



311
312
313
314
315
# File 'lib/couchbase/search_options.rb', line 311

def to_h
  data = {:ids => @doc_ids.flatten.uniq}
  data[:boost] = boost if boost
  data
end