Struct google_api_proto::google::cloud::contentwarehouse::v1::SearchDocumentsRequest
source · pub struct SearchDocumentsRequest {
pub parent: String,
pub request_metadata: Option<RequestMetadata>,
pub document_query: Option<DocumentQuery>,
pub offset: i32,
pub page_size: i32,
pub page_token: String,
pub order_by: String,
pub histogram_queries: Vec<HistogramQuery>,
pub require_total_size: bool,
pub total_result_size: i32,
pub qa_size_limit: i32,
}
Expand description
Request message for DocumentService.SearchDocuments.
Fields§
§parent: String
Required. The parent, which owns this collection of documents. Format: projects/{project_number}/locations/{location}.
request_metadata: Option<RequestMetadata>
The meta information collected about the end user, used to enforce access control and improve the search quality of the service.
document_query: Option<DocumentQuery>
Query used to search against documents (keyword, filters, etc.).
offset: i32
An integer that specifies the current offset (that is, starting result location, amongst the documents deemed by the API as relevant) in search results. This field is only considered if [page_token][google.cloud.contentwarehouse.v1.SearchDocumentsRequest.page_token] is unset.
The maximum allowed value is 5000. Otherwise an error is thrown.
For example, 0 means to return results starting from the first matching document, and 10 means to return from the 11th document. This can be used for pagination, (for example, pageSize = 10 and offset = 10 means to return from the second page).
page_size: i32
A limit on the number of documents returned in the search results. Increasing this value above the default value of 10 can increase search response time. The value can be between 1 and 100.
page_token: String
The token specifying the current offset within search results. See [SearchDocumentsResponse.next_page_token][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.next_page_token] for an explanation of how to obtain the next set of query results.
order_by: String
The criteria determining how search results are sorted. For non-empty
query, default is "relevance desc"
. For empty query, default is
"upload_date desc"
.
Supported options are:
"relevance desc"
: By relevance descending, as determined by the API algorithms."upload_date desc"
: By upload date descending."upload_date"
: By upload date ascending."update_date desc"
: By last updated date descending."update_date"
: By last updated date ascending."retrieval_importance desc"
: By retrieval importance of properties descending. This feature is still under development, please do not use unless otherwise instructed to do so.
histogram_queries: Vec<HistogramQuery>
An expression specifying a histogram request against matching documents. Expression syntax is an aggregation function call with histogram facets and other options.
The following aggregation functions are supported:
count(string_histogram_facet)
: Count the number of matching entities for each distinct attribute value.
Data types:
- Histogram facet (aka filterable properties): Facet names with format
<schema id>.<facet>. Facets will have the
format of:
[a-zA-Z][a-zA-Z0-9_:/-.]
. If the facet is a child facet, then the parent hierarchy needs to be specified separated by dots in the prefix after the schema id. Thus, the format for a multi- level facet is: <schema id>.<parent facet name>. <child facet name>. Example: schema123.root_parent_facet.middle_facet.child_facet - DocumentSchemaId: (with no schema id prefix) to get histograms for each document type (returns the schema id path, e.g. projects/12345/locations/us-west/documentSchemas/abc123).
Example expression:
-
Document type counts: count(‘DocumentSchemaId’)
-
For schema id, abc123, get the counts for MORTGAGE_TYPE: count(‘abc123.MORTGAGE_TYPE’)
require_total_size: bool
Controls if the search document request requires the return of a total size of matched documents. See [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
Enabling this flag may adversely impact performance. Hint: If this is used with pagination, set this flag on the initial query but set this to false on subsequent page calls (keep the total count locally).
Defaults to false.
total_result_size: i32
Controls if the search document request requires the return of a total size of matched documents. See [SearchDocumentsResponse.total_size][google.cloud.contentwarehouse.v1.SearchDocumentsResponse.total_size].
qa_size_limit: i32
Experimental, do not use. The limit on the number of documents returned for the question-answering feature. To enable the question-answering feature, set [DocumentQuery].[is_nl_query][] to true.
Implementations§
source§impl SearchDocumentsRequest
impl SearchDocumentsRequest
sourcepub fn total_result_size(&self) -> TotalResultSize
pub fn total_result_size(&self) -> TotalResultSize
Returns the enum value of total_result_size
, or the default if the field is set to an invalid enum value.
sourcepub fn set_total_result_size(&mut self, value: TotalResultSize)
pub fn set_total_result_size(&mut self, value: TotalResultSize)
Sets total_result_size
to the provided enum value.
Trait Implementations§
source§impl Clone for SearchDocumentsRequest
impl Clone for SearchDocumentsRequest
source§fn clone(&self) -> SearchDocumentsRequest
fn clone(&self) -> SearchDocumentsRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SearchDocumentsRequest
impl Debug for SearchDocumentsRequest
source§impl Default for SearchDocumentsRequest
impl Default for SearchDocumentsRequest
source§impl Message for SearchDocumentsRequest
impl Message for SearchDocumentsRequest
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for SearchDocumentsRequest
impl PartialEq for SearchDocumentsRequest
source§fn eq(&self, other: &SearchDocumentsRequest) -> bool
fn eq(&self, other: &SearchDocumentsRequest) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for SearchDocumentsRequest
Auto Trait Implementations§
impl Freeze for SearchDocumentsRequest
impl RefUnwindSafe for SearchDocumentsRequest
impl Send for SearchDocumentsRequest
impl Sync for SearchDocumentsRequest
impl Unpin for SearchDocumentsRequest
impl UnwindSafe for SearchDocumentsRequest
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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