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

source

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.

source

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

source§

fn clone(&self) -> SearchDocumentsRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SearchDocumentsRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SearchDocumentsRequest

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Message for SearchDocumentsRequest

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for SearchDocumentsRequest

source§

fn eq(&self, other: &SearchDocumentsRequest) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for SearchDocumentsRequest

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more