#[non_exhaustive]pub struct SearchParams {
pub max_return_results: i32,
pub filter: String,
pub boost_spec: Option<BoostSpec>,
pub order_by: String,
pub search_result_mode: SearchResultMode,
pub data_store_specs: Vec<DataStoreSpec>,
/* private fields */
}conversational-search-service only.Expand description
Search parameters.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_return_results: i32Number of search results to return. The default value is 10.
filter: StringThe filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. This will be used to filter search results which may affect the Answer response.
If this field is unrecognizable, an INVALID_ARGUMENT is returned.
Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend – this mapping is defined by the customer in their schema. For example a media customers might have a field ‘name’ in their schema. In this case the filter would look like this: filter –> name:‘ANY(“king kong”)’
For more information about filtering including syntax and filter operators, see Filter
boost_spec: Option<BoostSpec>Boost specification to boost certain documents in search results which may affect the answer query response. For more information on boosting, see Boosting
order_by: StringThe order in which documents are returned. Documents can be ordered
by a field in an Document
object. Leave it unset if ordered by relevance. order_by expression
is case-sensitive. For more information on ordering, see
Ordering
If this field is unrecognizable, an INVALID_ARGUMENT is returned.
search_result_mode: SearchResultModeSpecifies the search result mode. If unspecified, the
search result mode defaults to DOCUMENTS.
See parse and chunk
documents
data_store_specs: Vec<DataStoreSpec>Specs defining dataStores to filter on in a search call and configurations for those dataStores. This is only considered for engines with multiple dataStores use case. For single dataStore within an engine, they should use the specs at the top level.
Implementations§
Source§impl SearchParams
impl SearchParams
pub fn new() -> Self
Sourcepub fn set_max_return_results<T: Into<i32>>(self, v: T) -> Self
pub fn set_max_return_results<T: Into<i32>>(self, v: T) -> Self
Sets the value of max_return_results.
§Example
let x = SearchParams::new().set_max_return_results(42);Sourcepub fn set_filter<T: Into<String>>(self, v: T) -> Self
pub fn set_filter<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_boost_spec<T>(self, v: T) -> Self
pub fn set_boost_spec<T>(self, v: T) -> Self
Sets the value of boost_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::BoostSpec;
let x = SearchParams::new().set_boost_spec(BoostSpec::default()/* use setters */);Sourcepub fn set_or_clear_boost_spec<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_boost_spec<T>(self, v: Option<T>) -> Self
Sets or clears the value of boost_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::BoostSpec;
let x = SearchParams::new().set_or_clear_boost_spec(Some(BoostSpec::default()/* use setters */));
let x = SearchParams::new().set_or_clear_boost_spec(None::<BoostSpec>);Sourcepub fn set_order_by<T: Into<String>>(self, v: T) -> Self
pub fn set_order_by<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_search_result_mode<T: Into<SearchResultMode>>(self, v: T) -> Self
pub fn set_search_result_mode<T: Into<SearchResultMode>>(self, v: T) -> Self
Sets the value of search_result_mode.
§Example
use google_cloud_discoveryengine_v1::model::search_request::content_search_spec::SearchResultMode;
let x0 = SearchParams::new().set_search_result_mode(SearchResultMode::Documents);
let x1 = SearchParams::new().set_search_result_mode(SearchResultMode::Chunks);Sourcepub fn set_data_store_specs<T, V>(self, v: T) -> Self
pub fn set_data_store_specs<T, V>(self, v: T) -> Self
Sets the value of data_store_specs.
§Example
use google_cloud_discoveryengine_v1::model::search_request::DataStoreSpec;
let x = SearchParams::new()
.set_data_store_specs([
DataStoreSpec::default()/* use setters */,
DataStoreSpec::default()/* use (different) setters */,
]);Trait Implementations§
Source§impl Clone for SearchParams
impl Clone for SearchParams
Source§fn clone(&self) -> SearchParams
fn clone(&self) -> SearchParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more