Class: Couchbase::VectorQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/search_options.rb,
/code/couchbase-ruby-client/lib/couchbase/search_options.rb

Overview

Stability:

  • Uncommitted: This API may change in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vector_field_name, vector_query) ⇒ VectorQuery #initialize(vector_field_name, base64_vector_query) ⇒ VectorQuery

Constructs a VectorQuery instance

Overloads:

  • #initialize(vector_field_name, vector_query) ⇒ VectorQuery

    Parameters:

    • vector_field_name (String)

      the document field that contains the vector.

    • vector_query (Array<Float>)

      the vector query.

  • #initialize(vector_field_name, base64_vector_query) ⇒ VectorQuery

    Parameters:

    • vector_field_name (String)

      the document field that contains the vector.

    • base64_vector_query (String)

      the vector query represented as a base64-encoded sequence of little-endian IEEE 754 floats.

Yield Parameters:

Stability:

  • Uncommitted: This API may change in the future.



1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
# File 'lib/couchbase/search_options.rb', line 1087

def initialize(vector_field_name, vector_query)
  @vector_field_name = vector_field_name

  if vector_query.respond_to?(:to_str)
    @base64_vector_query = vector_query.to_str
  else
    @vector_query = vector_query
  end

  yield self if block_given?
end

Instance Attribute Details

#boostFloat?

Returns:

  • (Float, nil)

Stability:

  • Uncommitted: This API may change in the future.



1074
1075
1076
# File 'lib/couchbase/search_options.rb', line 1074

def boost
  @boost
end

#num_candidatesInteger?

Returns:

  • (Integer, nil)

Stability:

  • Uncommitted: This API may change in the future.



1071
1072
1073
# File 'lib/couchbase/search_options.rb', line 1071

def num_candidates
  @num_candidates
end