Class: Couchbase::SearchQuery::DocIdQuery

Inherits:
Couchbase::SearchQuery 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

Methods inherited from Couchbase::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(*doc_ids) {|self| ... } ⇒ DocIdQuery

Returns a new instance of DocIdQuery.

Parameters:

  • doc_ids (String...)

Yield Parameters:



302
303
304
305
306
# File 'lib/couchbase/search_options.rb', line 302

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

Instance Attribute Details

#boostFloat

Returns:

  • (Float)


297
298
299
# File 'lib/couchbase/search_options.rb', line 297

def boost
  @boost
end

Instance Method Details

#to_hHash<Symbol, #to_json>

Returns:



309
310
311
312
313
# File 'lib/couchbase/search_options.rb', line 309

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