Class: Couchbase::VectorSearch
- Inherits:
-
Object
- Object
- Couchbase::VectorSearch
- Defined in:
- lib/couchbase/search_options.rb
Instance Method Summary collapse
-
#initialize(vector_queries, options = Options::VectorSearch::DEFAULT) ⇒ VectorSearch
constructor
Constructs a
VectorSearch
instance, which allows one or more individual vector queries to be executed. - #to_backend ⇒ Object private
Constructor Details
#initialize(vector_queries, options = Options::VectorSearch::DEFAULT) ⇒ VectorSearch
Constructs a VectorSearch
instance, which allows one or more individual vector queries to be executed.
1055 1056 1057 1058 |
# File 'lib/couchbase/search_options.rb', line 1055 def initialize(vector_queries, = Options::VectorSearch::DEFAULT) @vector_queries = vector_queries.respond_to?(:each) ? vector_queries : [vector_queries] @options = end |
Instance Method Details
#to_backend ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1061 1062 1063 1064 1065 |
# File 'lib/couchbase/search_options.rb', line 1061 def to_backend raise Error::InvalidArgument, "Vector search requires at least one vector query" if @vector_queries.empty? {vector_queries: @vector_queries.map(&:to_h).to_json}.merge(@options.to_backend) end |