#[non_exhaustive]pub struct ContentSearchSpec {
pub snippet_spec: Option<SnippetSpec>,
pub summary_spec: Option<SummarySpec>,
pub extractive_content_spec: Option<ExtractiveContentSpec>,
pub search_result_mode: SearchResultMode,
pub chunk_spec: Option<ChunkSpec>,
/* private fields */
}assistant-service or conversational-search-service or search-service or serving-config-service only.Expand description
A specification for configuring the behavior of content search.
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.snippet_spec: Option<SnippetSpec>If snippetSpec is not specified, snippets are not included in the
search response.
summary_spec: Option<SummarySpec>If summarySpec is not specified, summaries are not included in the
search response.
extractive_content_spec: Option<ExtractiveContentSpec>If there is no extractive_content_spec provided, there will be no extractive answer in the search response.
search_result_mode: SearchResultModeSpecifies the search result mode. If unspecified, the
search result mode defaults to DOCUMENTS.
chunk_spec: Option<ChunkSpec>Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS
Implementations§
Source§impl ContentSearchSpec
impl ContentSearchSpec
pub fn new() -> Self
Sourcepub fn set_snippet_spec<T>(self, v: T) -> Selfwhere
T: Into<SnippetSpec>,
pub fn set_snippet_spec<T>(self, v: T) -> Selfwhere
T: Into<SnippetSpec>,
Sets the value of snippet_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::content_search_spec::SnippetSpec;
let x = ContentSearchSpec::new().set_snippet_spec(SnippetSpec::default()/* use setters */);Sourcepub fn set_or_clear_snippet_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<SnippetSpec>,
pub fn set_or_clear_snippet_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<SnippetSpec>,
Sets or clears the value of snippet_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::content_search_spec::SnippetSpec;
let x = ContentSearchSpec::new().set_or_clear_snippet_spec(Some(SnippetSpec::default()/* use setters */));
let x = ContentSearchSpec::new().set_or_clear_snippet_spec(None::<SnippetSpec>);Sourcepub fn set_summary_spec<T>(self, v: T) -> Selfwhere
T: Into<SummarySpec>,
pub fn set_summary_spec<T>(self, v: T) -> Selfwhere
T: Into<SummarySpec>,
Sets the value of summary_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::content_search_spec::SummarySpec;
let x = ContentSearchSpec::new().set_summary_spec(SummarySpec::default()/* use setters */);Sourcepub fn set_or_clear_summary_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<SummarySpec>,
pub fn set_or_clear_summary_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<SummarySpec>,
Sets or clears the value of summary_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::content_search_spec::SummarySpec;
let x = ContentSearchSpec::new().set_or_clear_summary_spec(Some(SummarySpec::default()/* use setters */));
let x = ContentSearchSpec::new().set_or_clear_summary_spec(None::<SummarySpec>);Sourcepub fn set_extractive_content_spec<T>(self, v: T) -> Selfwhere
T: Into<ExtractiveContentSpec>,
pub fn set_extractive_content_spec<T>(self, v: T) -> Selfwhere
T: Into<ExtractiveContentSpec>,
Sets the value of extractive_content_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::content_search_spec::ExtractiveContentSpec;
let x = ContentSearchSpec::new().set_extractive_content_spec(ExtractiveContentSpec::default()/* use setters */);Sourcepub fn set_or_clear_extractive_content_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<ExtractiveContentSpec>,
pub fn set_or_clear_extractive_content_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<ExtractiveContentSpec>,
Sets or clears the value of extractive_content_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::content_search_spec::ExtractiveContentSpec;
let x = ContentSearchSpec::new().set_or_clear_extractive_content_spec(Some(ExtractiveContentSpec::default()/* use setters */));
let x = ContentSearchSpec::new().set_or_clear_extractive_content_spec(None::<ExtractiveContentSpec>);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 = ContentSearchSpec::new().set_search_result_mode(SearchResultMode::Documents);
let x1 = ContentSearchSpec::new().set_search_result_mode(SearchResultMode::Chunks);Sourcepub fn set_chunk_spec<T>(self, v: T) -> Self
pub fn set_chunk_spec<T>(self, v: T) -> Self
Sets the value of chunk_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::content_search_spec::ChunkSpec;
let x = ContentSearchSpec::new().set_chunk_spec(ChunkSpec::default()/* use setters */);Sourcepub fn set_or_clear_chunk_spec<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_chunk_spec<T>(self, v: Option<T>) -> Self
Sets or clears the value of chunk_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::content_search_spec::ChunkSpec;
let x = ContentSearchSpec::new().set_or_clear_chunk_spec(Some(ChunkSpec::default()/* use setters */));
let x = ContentSearchSpec::new().set_or_clear_chunk_spec(None::<ChunkSpec>);Trait Implementations§
Source§impl Clone for ContentSearchSpec
impl Clone for ContentSearchSpec
Source§fn clone(&self) -> ContentSearchSpec
fn clone(&self) -> ContentSearchSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more