Couchbase C++ SDK 1.0.1 (rev. 58d46d7)
Loading...
Searching...
No Matches
vector_query Class Reference

#include <couchbase/vector_query.hxx>

Public Member Functions

 vector_query (std::string vector_field_name, std::vector< double > vector_query)
 Creates a vector query.
 
 vector_query (std::string vector_field_name, std::string base64_vector_query)
 Creates a vector query.
 
auto num_candidates (std::uint32_t num_candidates) -> vector_query &
 The number of results that will be returned from this vector query.
 
auto boost (double boost) -> vector_query &
 The boost parameter is used to increase the relative weight of a clause (with a boost greater than 1) or decrease the relative weight (with a boost between 0 and 1).
 
auto encode () const -> encoded_search_query
 

Detailed Description

Since
1.0.0
Committed
Generally available API and should be preferred in production

Constructor & Destructor Documentation

◆ vector_query() [1/2]

vector_query ( std::string vector_field_name,
std::vector< double > vector_query )
inline

Creates a vector query.

Parameters
vector_field_namethe document field that contains the vector
vector_querythe vector query to run. Cannot be empty.
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ vector_query() [2/2]

vector_query ( std::string vector_field_name,
std::string base64_vector_query )
inline

Creates a vector query.

Parameters
vector_field_namethe document field that contains the vector
base64_vector_querya base64-encoded sequence of little-endian IEEE 754 floats
std::string base64_encoded_query = "RWFzdGVyIGVnZyE=";
auto query = couchbase::vector_query("foo", base64_encoded_query).boost(0.5).num_candidates(4);
Since
1.0.0
Committed
Generally available API and should be preferred in production

Member Function Documentation

◆ boost()

auto boost ( double boost) -> vector_query&
inline

The boost parameter is used to increase the relative weight of a clause (with a boost greater than 1) or decrease the relative weight (with a boost between 0 and 1).

Parameters
boostboost value
Returns
this vector_query for chaining purposes.
Since
1.0.0
Committed
Generally available API and should be preferred in production

◆ encode()

auto encode ( ) const -> encoded_search_query
Returns
encoded representation of the query.
Since
1.0.0
Internal
Internal interface

◆ num_candidates()

auto num_candidates ( std::uint32_t num_candidates) -> vector_query&
inline

The number of results that will be returned from this vector query.

Defaults to 3.

Parameters
num_candidatesthe number of results returned
Returns
this vector_query for chaining purposes
Since
1.0.0
Committed
Generally available API and should be preferred in production

The documentation for this class was generated from the following file: