#[non_exhaustive]pub struct Search {
pub search_type: Option<SearchType>,
/* private fields */
}Expand description
A single search request within a batch operation.
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.search_type: Option<SearchType>The type of search to perform.
Implementations§
Source§impl Search
impl Search
pub fn new() -> Self
Sourcepub fn set_search_type<T: Into<Option<SearchType>>>(self, v: T) -> Self
pub fn set_search_type<T: Into<Option<SearchType>>>(self, v: T) -> Self
Sets the value of search_type.
Note that all the setters affecting search_type are mutually
exclusive.
§Example
use google_cloud_vectorsearch_v1::model::VectorSearch;
let x = Search::new().set_search_type(Some(
google_cloud_vectorsearch_v1::model::search::SearchType::VectorSearch(VectorSearch::default().into())));Sourcepub fn vector_search(&self) -> Option<&Box<VectorSearch>>
pub fn vector_search(&self) -> Option<&Box<VectorSearch>>
The value of search_type
if it holds a VectorSearch, None if the field is not set or
holds a different branch.
Sourcepub fn set_vector_search<T: Into<Box<VectorSearch>>>(self, v: T) -> Self
pub fn set_vector_search<T: Into<Box<VectorSearch>>>(self, v: T) -> Self
Sets the value of search_type
to hold a VectorSearch.
Note that all the setters affecting search_type are
mutually exclusive.
§Example
use google_cloud_vectorsearch_v1::model::VectorSearch;
let x = Search::new().set_vector_search(VectorSearch::default()/* use setters */);
assert!(x.vector_search().is_some());
assert!(x.semantic_search().is_none());
assert!(x.text_search().is_none());Sourcepub fn semantic_search(&self) -> Option<&Box<SemanticSearch>>
pub fn semantic_search(&self) -> Option<&Box<SemanticSearch>>
The value of search_type
if it holds a SemanticSearch, None if the field is not set or
holds a different branch.
Sourcepub fn set_semantic_search<T: Into<Box<SemanticSearch>>>(self, v: T) -> Self
pub fn set_semantic_search<T: Into<Box<SemanticSearch>>>(self, v: T) -> Self
Sets the value of search_type
to hold a SemanticSearch.
Note that all the setters affecting search_type are
mutually exclusive.
§Example
use google_cloud_vectorsearch_v1::model::SemanticSearch;
let x = Search::new().set_semantic_search(SemanticSearch::default()/* use setters */);
assert!(x.semantic_search().is_some());
assert!(x.vector_search().is_none());
assert!(x.text_search().is_none());Sourcepub fn text_search(&self) -> Option<&Box<TextSearch>>
pub fn text_search(&self) -> Option<&Box<TextSearch>>
The value of search_type
if it holds a TextSearch, None if the field is not set or
holds a different branch.
Sourcepub fn set_text_search<T: Into<Box<TextSearch>>>(self, v: T) -> Self
pub fn set_text_search<T: Into<Box<TextSearch>>>(self, v: T) -> Self
Sets the value of search_type
to hold a TextSearch.
Note that all the setters affecting search_type are
mutually exclusive.
§Example
use google_cloud_vectorsearch_v1::model::TextSearch;
let x = Search::new().set_text_search(TextSearch::default()/* use setters */);
assert!(x.text_search().is_some());
assert!(x.vector_search().is_none());
assert!(x.semantic_search().is_none());