45 : vector_field_name_{ std::move(vector_field_name) }
48 if (vector_query_.value().empty()) {
49 throw std::invalid_argument(
"the vector_query cannot be empty");
63 vector_query(std::string vector_field_name, std::string base64_vector_query)
64 : vector_field_name_{ std::move(vector_field_name) }
65 , base64_vector_query_{ std::move(base64_vector_query) }
67 if (base64_vector_query_.value().empty()) {
68 throw std::invalid_argument(
"the base64_vector_query cannot be empty");
85 throw std::invalid_argument(
"The num_candidates cannot be less than 1");
119 template<
typename SearchQuery>
122 prefilter_ = std::make_shared<SearchQuery>(std::move(
prefilter));
132 [[nodiscard]]
auto encode() const -> encoded_search_query;
135 std::
string vector_field_name_;
136 std::uint32_t num_candidates_{ 3 };
137 std::optional<std::vector<double>> vector_query_{};
138 std::optional<std::string> base64_vector_query_{};
139 std::optional<double> boost_{};
140 std::shared_ptr<search_query> prefilter_{};
vector_query(std::string vector_field_name, std::string base64_vector_query)
Creates a vector query.
Definition vector_query.hxx:63
auto encode() const -> encoded_search_query
auto num_candidates(std::uint32_t num_candidates) -> vector_query &
The number of results that will be returned from this vector query.
Definition vector_query.hxx:82
vector_query(std::string vector_field_name, std::vector< double > vector_query)
Creates a vector query.
Definition vector_query.hxx:44
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)...
Definition vector_query.hxx:102
auto prefilter(SearchQuery prefilter) -> vector_query &
Sets a prefilter, which allows defining a subset of the vector index, over which the vector search wi...
Definition vector_query.hxx:120
Represents a single item from the result of scan()
Definition allow_querying_search_index_options.hxx:28