Skip to main content

aws_sdk_opensearchmemory/client/
search_memories.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 [`SearchMemories`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder) operation.
4    /// This operation supports pagination; See [`into_paginator()`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::into_paginator).
5    ///
6    /// - The fluent builder is configurable:
7    ///   - [`space_id(impl Into<String>)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::space_id) / [`set_space_id(Option<String>)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::set_space_id):<br>required: **true**<br><p>The space to search. Use <code>actorId</code> to narrow the search within it.</p><br>
8    ///   - [`memory_strategies(StrategySelector)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::memory_strategies) / [`set_memory_strategies(Option<Vec::<StrategySelector>>)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::set_memory_strategies):<br>required: **false**<br><p>The strategies to search, as a list of selectors. Each selector names a memory type and, optionally, specific strategy names of that type. A space can hold several strategies of the same type. A selector without <code>memoryStrategyNames</code> searches every strategy of its type, and omitting <code>memoryStrategies</code> searches every strategy in the space. A name that is not a declared strategy of that type fails with <code>ValidationException</code>.</p><br>
9    ///   - [`actor_id(impl Into<String>)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::actor_id) / [`set_actor_id(Option<String>)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::set_actor_id):<br>required: **true**<br><p>The actor whose memories to search (exact match). Required: every search covers exactly one actor, and a memory stored without an actor is never returned. This is the only way to filter by actor: a query that references <code>system_metadata.actor_id</code> fails with <code>ValidationException</code> (reason <code>nonFilterableField</code>).</p><br>
10    ///   - [`query(Document)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::query) / [`set_query(Option<Document>)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::set_query):<br>required: **true**<br><p>The query: a subset of the OpenSearch Query DSL (see <code>SearchQuery</code>). You can't use the actor and session fields <code>system_metadata.actor_id</code> and <code>system_metadata.session_id</code> here. Use the top-level <code>actorId</code> to filter by actor. Searching memories doesn't filter by session.</p><br>
11    ///   - [`sort(Document)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::sort) / [`set_sort(Option<Document>)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::set_sort):<br>required: **false**<br><p>The sort order (see <code>SearchSort</code>). Omit to return the most relevant memories first.</p><br>
12    ///   - [`max_results(i32)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::max_results) / [`set_max_results(Option<i32>)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::set_max_results):<br>required: **false**<br><p>The maximum number of memories to return, from 1 to 100. The default is 20.</p><br>
13    ///   - [`next_token(impl Into<String>)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::next_token) / [`set_next_token(Option<String>)`](crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::set_next_token):<br>required: **false**<br><p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p><br>
14    /// - On success, responds with [`SearchMemoriesOutput`](crate::operation::search_memories::SearchMemoriesOutput) with field(s):
15    ///   - [`memories(Vec::<MemorySearchSummary>)`](crate::operation::search_memories::SearchMemoriesOutput::memories): <p>The matching memories, in the order <code>sort</code> requests, or most relevant first when it has none. Empty when nothing matches.</p>
16    ///   - [`next_token(Option<String>)`](crate::operation::search_memories::SearchMemoriesOutput::next_token): <p>The token for the next set of results. Absent when there are no more results.</p>
17    /// - On failure, responds with [`SdkError<SearchMemoriesError>`](crate::operation::search_memories::SearchMemoriesError)
18    pub fn search_memories(&self) -> crate::operation::search_memories::builders::SearchMemoriesFluentBuilder {
19        crate::operation::search_memories::builders::SearchMemoriesFluentBuilder::new(self.handle.clone())
20    }
21}