#[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
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContentSearchSpec
impl Debug for ContentSearchSpec
Source§impl Default for ContentSearchSpec
impl Default for ContentSearchSpec
Source§fn default() -> ContentSearchSpec
fn default() -> ContentSearchSpec
Source§impl Message for ContentSearchSpec
impl Message for ContentSearchSpec
Source§impl PartialEq for ContentSearchSpec
impl PartialEq for ContentSearchSpec
impl StructuralPartialEq for ContentSearchSpec
Auto Trait Implementations§
impl Freeze for ContentSearchSpec
impl RefUnwindSafe for ContentSearchSpec
impl Send for ContentSearchSpec
impl Sync for ContentSearchSpec
impl Unpin for ContentSearchSpec
impl UnsafeUnpin for ContentSearchSpec
impl UnwindSafe for ContentSearchSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request