Skip to main content

aws_sdk_dynamodb/client/
search_vectors.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`SearchVectors`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`table_name(impl Into<String>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::table_name) / [`set_table_name(Option<String>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::set_table_name):<br>required: **true**<br><p>The name or Amazon Resource Name (ARN) of the table containing the vector index.</p><br>
7    ///   - [`index_name(impl Into<String>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::index_name) / [`set_index_name(Option<String>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::set_index_name):<br>required: **true**<br><p>The name of the vector index to search. The index must be in the <code>ACTIVE</code> state.</p><br>
8    ///   - [`return_consumed_capacity(ReturnConsumedCapacity)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::return_consumed_capacity) / [`set_return_consumed_capacity(Option<ReturnConsumedCapacity>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::set_return_consumed_capacity):<br>required: **false**<br><p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p> <ul>  <li>   <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>   <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>  <li>   <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>  <li>   <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li> </ul><br>
9    ///   - [`expression_attribute_names(impl Into<String>, impl Into<String>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::expression_attribute_names) / [`set_expression_attribute_names(Option<HashMap::<String, String>>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::set_expression_attribute_names):<br>required: **false**<br><p>One or more substitution tokens for attribute names in an expression. Use the <code>#</code> character in an expression to dereference an attribute name.</p><br>
10    ///   - [`expression_attribute_values(impl Into<String>, AttributeValue)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::expression_attribute_values) / [`set_expression_attribute_values(Option<HashMap::<String, AttributeValue>>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::set_expression_attribute_values):<br>required: **false**<br><p>One or more values that can be substituted in an expression. Use the <code>:</code> character in an expression to dereference an attribute value.</p><br>
11    ///   - [`projection_expression(impl Into<String>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::projection_expression) / [`set_projection_expression(Option<String>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::set_projection_expression):<br>required: **false**<br><p>A string that identifies one or more attributes to retrieve from the index. Separate attribute names with commas. If not specified, the operation returns all attributes projected into the vector index.</p> <p>Only attributes projected into the vector index can be retrieved.</p><br>
12    ///   - [`search_vector(AttributeValue)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::search_vector) / [`set_search_vector(Option<Vec::<AttributeValue>>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::set_search_vector):<br>required: **true**<br><p>The search vector to compare against the indexed vectors. Each element is a 32-bit IEEE-754 floating point number, provided in DynamoDB list format.</p> <p>The number of dimensions must match the number of dimensions configured for the vector index.</p><br>
13    ///   - [`search_condition_expression(impl Into<String>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::search_condition_expression) / [`set_search_condition_expression(Option<String>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::set_search_condition_expression):<br>required: **false**<br><p>A condition expression used to filter the vector search results. The expression can reference attributes defined in the vector index search schema, including <code>HASH</code> and <code>INLINE_FILTER</code> key elements.</p> <p>Only the equality operator (<code>=</code>) is supported for <code>HASH</code> attributes. Comparison and range operators are supported for <code>INLINE_FILTER</code> attributes. Only top-level attributes from the search schema can be referenced.</p><br>
14    ///   - [`top_k(i32)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::top_k) / [`set_top_k(Option<i32>)`](crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::set_top_k):<br>required: **true**<br><p>The number of most similar results to return.</p><br>
15    /// - On success, responds with [`SearchVectorsOutput`](crate::operation::search_vectors::SearchVectorsOutput) with field(s):
16    ///   - [`consumed_capacity(Option<VectorCapacity>)`](crate::operation::search_vectors::SearchVectorsOutput::consumed_capacity): <p>The capacity units consumed by the <code>SearchVectors</code> operation. Contains <code>VectorSearchRequestBytes</code>, which represents the vector search capacity consumed.</p>
17    ///   - [`search_results(Option<Vec::<SearchResultItem>>)`](crate::operation::search_vectors::SearchVectorsOutput::search_results): <p>A list of items returned by the vector similarity search, sorted by similarity with the most similar item first. Each item contains the projected attributes and a similarity score.</p>
18    /// - On failure, responds with [`SdkError<SearchVectorsError>`](crate::operation::search_vectors::SearchVectorsError)
19    pub fn search_vectors(&self) -> crate::operation::search_vectors::builders::SearchVectorsFluentBuilder {
20        crate::operation::search_vectors::builders::SearchVectorsFluentBuilder::new(self.handle.clone())
21    }
22}