#[non_exhaustive]pub struct SearchRequest {Show 31 fields
pub serving_config: String,
pub branch: String,
pub query: String,
pub image_query: Option<ImageQuery>,
pub page_size: i32,
pub page_token: String,
pub offset: i32,
pub one_box_page_size: i32,
pub data_store_specs: Vec<DataStoreSpec>,
pub filter: String,
pub canonical_filter: String,
pub order_by: String,
pub user_info: Option<UserInfo>,
pub language_code: String,
pub facet_specs: Vec<FacetSpec>,
pub boost_spec: Option<BoostSpec>,
pub params: HashMap<String, Value>,
pub query_expansion_spec: Option<QueryExpansionSpec>,
pub spell_correction_spec: Option<SpellCorrectionSpec>,
pub user_pseudo_id: String,
pub content_search_spec: Option<ContentSearchSpec>,
pub safe_search: bool,
pub user_labels: HashMap<String, String>,
pub search_as_you_type_spec: Option<SearchAsYouTypeSpec>,
pub display_spec: Option<DisplaySpec>,
pub session: String,
pub session_spec: Option<SessionSpec>,
pub relevance_threshold: RelevanceThreshold,
pub relevance_score_spec: Option<RelevanceScoreSpec>,
pub ranking_expression: String,
pub ranking_expression_backend: RankingExpressionBackend,
/* private fields */
}assistant-service or conversational-search-service or search-service or serving-config-service only.Expand description
Request message for SearchService.Search method.
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.serving_config: StringRequired. The resource name of the Search serving config, such as
projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config,
or
projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config.
This field is used to identify the serving configuration name, set
of models used to make the search.
branch: StringThe branch resource name, such as
projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0.
Use default_branch as the branch ID or leave this field empty, to search
documents under the default branch.
query: StringRaw search query.
image_query: Option<ImageQuery>Raw image query.
page_size: i32Maximum number of Documents to return. The maximum allowed value depends on the data type. Values above the maximum value are coerced to the maximum value.
- Websites with basic indexing: Default
10, Maximum25. - Websites with advanced indexing: Default
25, Maximum50. - Other: Default
50, Maximum100.
If this field is negative, an INVALID_ARGUMENT is returned.
page_token: StringA page token received from a previous SearchService.Search call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to
SearchService.Search
must match the call that provided the page token. Otherwise, an
INVALID_ARGUMENT error is returned.
offset: i32A 0-indexed 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 is unset.
If this field is negative, an INVALID_ARGUMENT is returned.
one_box_page_size: i32The maximum number of results to return for OneBox. This applies to each OneBox type individually. Default number is 10.
data_store_specs: Vec<DataStoreSpec>Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. For engines with a single data store, the specs directly under SearchRequest should be used.
filter: StringThe filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive.
If this field is unrecognizable, an INVALID_ARGUMENT is returned.
Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend – this mapping is defined by the customer in their schema. For example a media customer might have a field ‘name’ in their schema. In this case the filter would look like this: filter –> name:‘ANY(“king kong”)’
For more information about filtering including syntax and filter operators, see Filter
canonical_filter: StringThe default filter that is applied when a user performs a search without checking any filters on the search page.
The filter applied to every search request when quality improvement such as query expansion is needed. In the case a query does not have a sufficient amount of results this filter will be used to determine whether or not to enable the query expansion flow. The original filter will still be used for the query expanded search. This field is strongly recommended to achieve high search quality.
For more information about filter syntax, see SearchRequest.filter.
order_by: StringThe order in which documents are returned. Documents can be ordered by
a field in an Document object.
Leave it unset if ordered by relevance. order_by expression is
case-sensitive.
For more information on ordering the website search results, see
Order web search
results.
For more information on ordering the healthcare search results, see
Order healthcare search
results.
If this field is unrecognizable, an INVALID_ARGUMENT is returned.
user_info: Option<UserInfo>Information about the end user.
Highly recommended for analytics and personalization.
UserInfo.user_agent
is used to deduce device_type for analytics.
language_code: StringThe BCP-47 language code, such as “en-US” or “sr-Latn”. For more information, see Standard fields. This field helps to better interpret the query. If a value isn’t specified, the query language code is automatically detected, which may not be accurate.
facet_specs: Vec<FacetSpec>Facet specifications for faceted search. If empty, no facets are returned.
A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT
error is returned.
boost_spec: Option<BoostSpec>Boost specification to boost certain documents. For more information on boosting, see Boosting
params: HashMap<String, Value>Additional search parameters.
For public website search only, supported values are:
-
user_country_code: string. Default empty. If set to non-empty, results are restricted or boosted based on the location provided. For example,user_country_code: "au"For available codes see Country Codes
-
search_type: double. Default empty. Enables non-webpage searching depending on the value. The only valid non-default value is 1, which enables image searching. For example,search_type: 1
query_expansion_spec: Option<QueryExpansionSpec>The query expansion specification that specifies the conditions under which query expansion occurs.
spell_correction_spec: Option<SpellCorrectionSpec>The spell correction specification that specifies the mode under which spell correction takes effect.
user_pseudo_id: StringA unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website.
This field should NOT have a fixed value such as unknown_visitor.
This should be the same identifier as UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id
The field must be a UTF-8 encoded string with a length limit of 128
characters. Otherwise, an INVALID_ARGUMENT error is returned.
content_search_spec: Option<ContentSearchSpec>A specification for configuring the behavior of content search.
safe_search: boolWhether to turn on safe search. This is only supported for website search.
user_labels: HashMap<String, String>The user labels applied to a resource must meet the following requirements:
- Each resource can have multiple labels, up to a maximum of 64.
- Each label must be a key-value pair.
- Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
- Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
- The key portion of a label must be unique. However, you can use the same key with multiple resources.
- Keys must start with a lowercase letter or international character.
See Google Cloud Document for more details.
search_as_you_type_spec: Option<SearchAsYouTypeSpec>Search as you type configuration. Only supported for the IndustryVertical.MEDIA vertical.
display_spec: Option<DisplaySpec>Optional. Config for display feature, like match highlighting on search results.
session: StringThe session resource name. Optional.
Session allows users to do multi-turn /search API calls or coordination between /search API calls and /answer API calls.
Example #1 (multi-turn /search API calls): Call /search API with the session ID generated in the first call. Here, the previous search query gets considered in query standing. I.e., if the first query is “How did Alphabet do in 2022?” and the current query is “How about 2023?”, the current query will be interpreted as “How did Alphabet do in 2023?”.
Example #2 (coordination between /search API calls and /answer API calls): Call /answer API with the session ID generated in the first call. Here, the answer generation happens in the context of the search results from the first search call.
Multi-turn Search feature is currently at private GA stage. Please use v1alpha or v1beta version instead before we launch this feature to public GA. Or ask for allowlisting through Google Support team.
session_spec: Option<SessionSpec>Session specification.
Can be used only when session is set.
relevance_threshold: RelevanceThresholdThe relevance threshold of the search results.
Default to Google defined threshold, leveraging a balance of precision and recall to deliver both highly accurate results and comprehensive coverage of relevant information.
This feature is not supported for healthcare search.
relevance_score_spec: Option<RelevanceScoreSpec>Optional. The specification for returning the relevance score.
ranking_expression: StringThe ranking expression controls the customized ranking on retrieval
documents. This overrides
ServingConfig.ranking_expression.
The syntax and supported features depend on the
ranking_expression_backend value. If ranking_expression_backend is not
provided, it defaults to RANK_BY_EMBEDDING.
If
ranking_expression_backend
is not provided or set to RANK_BY_EMBEDDING, it should be a single
function or multiple functions that are joined by “+”.
- ranking_expression = function, { “ + “, function };
Supported functions:
- double * relevance_score
- double * dotProduct(embedding_field_path)
Function variables:
relevance_score: pre-defined keywords, used for measure relevance between query and document.embedding_field_path: the document embedding field used with query embedding vector.dotProduct: embedding function betweenembedding_field_pathand query embedding vector.
Example ranking expression:
If document has an embedding field doc_embedding, the ranking expression
could be 0.5 * relevance_score + 0.3 * dotProduct(doc_embedding).
If
ranking_expression_backend
is set to RANK_BY_FORMULA, the following expression types (and
combinations of those chained using + or
-
operators) are supported:
doublesignallog(signal)exp(signal)rr(signal, double > 0)– reciprocal rank transformation with second argument being a denominator constant.is_nan(signal)– returns 0 if signal is NaN, 1 otherwise.fill_nan(signal1, signal2 | double)– if signal1 is NaN, returns signal2 | double, else returns signal1.
The following signals are supported:
semantic_similarity_score: semantic similarity adjustment that is calculated using the embeddings generated by a proprietary Google model. This score determines how semantically similar a search query is to a document.keyword_similarity_score: keyword match adjustment uses the Best Match 25 (BM25) ranking function. This score is calculated using a probabilistic model to estimate the probability that a document is relevant to a given query.relevance_score: semantic relevance adjustment that uses a proprietary Google model to determine the meaning and intent behind a user’s query in context with the content in the documents.pctr_rank: predicted conversion rate adjustment as a rank use predicted Click-through rate (pCTR) to gauge the relevance and attractiveness of a search result from a user’s perspective. A higher pCTR suggests that the result is more likely to satisfy the user’s query and intent, making it a valuable signal for ranking.freshness_rank: freshness adjustment as a rankdocument_age: The time in hours elapsed since the document was last updated, a floating-point number (e.g., 0.25 means 15 minutes).topicality_rank: topicality adjustment as a rank. Uses proprietary Google model to determine the keyword-based overlap between the query and the document.base_rank: the default rank of the result
ranking_expression_backend: RankingExpressionBackendThe backend to use for the ranking expression evaluation.
Implementations§
Source§impl SearchRequest
impl SearchRequest
pub fn new() -> Self
Sourcepub fn set_serving_config<T: Into<String>>(self, v: T) -> Self
pub fn set_serving_config<T: Into<String>>(self, v: T) -> Self
Sets the value of serving_config.
§Example
let x = SearchRequest::new().set_serving_config("example");Sourcepub fn set_branch<T: Into<String>>(self, v: T) -> Self
pub fn set_branch<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_image_query<T>(self, v: T) -> Selfwhere
T: Into<ImageQuery>,
pub fn set_image_query<T>(self, v: T) -> Selfwhere
T: Into<ImageQuery>,
Sets the value of image_query.
§Example
use google_cloud_discoveryengine_v1::model::search_request::ImageQuery;
let x = SearchRequest::new().set_image_query(ImageQuery::default()/* use setters */);Sourcepub fn set_or_clear_image_query<T>(self, v: Option<T>) -> Selfwhere
T: Into<ImageQuery>,
pub fn set_or_clear_image_query<T>(self, v: Option<T>) -> Selfwhere
T: Into<ImageQuery>,
Sets or clears the value of image_query.
§Example
use google_cloud_discoveryengine_v1::model::search_request::ImageQuery;
let x = SearchRequest::new().set_or_clear_image_query(Some(ImageQuery::default()/* use setters */));
let x = SearchRequest::new().set_or_clear_image_query(None::<ImageQuery>);Sourcepub fn set_page_size<T: Into<i32>>(self, v: T) -> Self
pub fn set_page_size<T: Into<i32>>(self, v: T) -> Self
Sourcepub fn set_page_token<T: Into<String>>(self, v: T) -> Self
pub fn set_page_token<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_offset<T: Into<i32>>(self, v: T) -> Self
pub fn set_offset<T: Into<i32>>(self, v: T) -> Self
Sourcepub fn set_one_box_page_size<T: Into<i32>>(self, v: T) -> Self
pub fn set_one_box_page_size<T: Into<i32>>(self, v: T) -> Self
Sets the value of one_box_page_size.
§Example
let x = SearchRequest::new().set_one_box_page_size(42);Sourcepub fn set_data_store_specs<T, V>(self, v: T) -> Self
pub fn set_data_store_specs<T, V>(self, v: T) -> Self
Sets the value of data_store_specs.
§Example
use google_cloud_discoveryengine_v1::model::search_request::DataStoreSpec;
let x = SearchRequest::new()
.set_data_store_specs([
DataStoreSpec::default()/* use setters */,
DataStoreSpec::default()/* use (different) setters */,
]);Sourcepub fn set_filter<T: Into<String>>(self, v: T) -> Self
pub fn set_filter<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_canonical_filter<T: Into<String>>(self, v: T) -> Self
pub fn set_canonical_filter<T: Into<String>>(self, v: T) -> Self
Sets the value of canonical_filter.
§Example
let x = SearchRequest::new().set_canonical_filter("example");Sourcepub fn set_order_by<T: Into<String>>(self, v: T) -> Self
pub fn set_order_by<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_user_info<T>(self, v: T) -> Self
pub fn set_user_info<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_user_info<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_user_info<T>(self, v: Option<T>) -> Self
Sourcepub fn set_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_language_code<T: Into<String>>(self, v: T) -> Self
Sets the value of language_code.
§Example
let x = SearchRequest::new().set_language_code("example");Sourcepub fn set_facet_specs<T, V>(self, v: T) -> Self
pub fn set_facet_specs<T, V>(self, v: T) -> Self
Sets the value of facet_specs.
§Example
use google_cloud_discoveryengine_v1::model::search_request::FacetSpec;
let x = SearchRequest::new()
.set_facet_specs([
FacetSpec::default()/* use setters */,
FacetSpec::default()/* use (different) setters */,
]);Sourcepub fn set_boost_spec<T>(self, v: T) -> Self
pub fn set_boost_spec<T>(self, v: T) -> Self
Sets the value of boost_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::BoostSpec;
let x = SearchRequest::new().set_boost_spec(BoostSpec::default()/* use setters */);Sourcepub fn set_or_clear_boost_spec<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_boost_spec<T>(self, v: Option<T>) -> Self
Sets or clears the value of boost_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::BoostSpec;
let x = SearchRequest::new().set_or_clear_boost_spec(Some(BoostSpec::default()/* use setters */));
let x = SearchRequest::new().set_or_clear_boost_spec(None::<BoostSpec>);Sourcepub fn set_params<T, K, V>(self, v: T) -> Self
pub fn set_params<T, K, V>(self, v: T) -> Self
Sourcepub fn set_query_expansion_spec<T>(self, v: T) -> Selfwhere
T: Into<QueryExpansionSpec>,
pub fn set_query_expansion_spec<T>(self, v: T) -> Selfwhere
T: Into<QueryExpansionSpec>,
Sets the value of query_expansion_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::QueryExpansionSpec;
let x = SearchRequest::new().set_query_expansion_spec(QueryExpansionSpec::default()/* use setters */);Sourcepub fn set_or_clear_query_expansion_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueryExpansionSpec>,
pub fn set_or_clear_query_expansion_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<QueryExpansionSpec>,
Sets or clears the value of query_expansion_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::QueryExpansionSpec;
let x = SearchRequest::new().set_or_clear_query_expansion_spec(Some(QueryExpansionSpec::default()/* use setters */));
let x = SearchRequest::new().set_or_clear_query_expansion_spec(None::<QueryExpansionSpec>);Sourcepub fn set_spell_correction_spec<T>(self, v: T) -> Selfwhere
T: Into<SpellCorrectionSpec>,
pub fn set_spell_correction_spec<T>(self, v: T) -> Selfwhere
T: Into<SpellCorrectionSpec>,
Sets the value of spell_correction_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::SpellCorrectionSpec;
let x = SearchRequest::new().set_spell_correction_spec(SpellCorrectionSpec::default()/* use setters */);Sourcepub fn set_or_clear_spell_correction_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<SpellCorrectionSpec>,
pub fn set_or_clear_spell_correction_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<SpellCorrectionSpec>,
Sets or clears the value of spell_correction_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::SpellCorrectionSpec;
let x = SearchRequest::new().set_or_clear_spell_correction_spec(Some(SpellCorrectionSpec::default()/* use setters */));
let x = SearchRequest::new().set_or_clear_spell_correction_spec(None::<SpellCorrectionSpec>);Sourcepub fn set_user_pseudo_id<T: Into<String>>(self, v: T) -> Self
pub fn set_user_pseudo_id<T: Into<String>>(self, v: T) -> Self
Sets the value of user_pseudo_id.
§Example
let x = SearchRequest::new().set_user_pseudo_id("example");Sourcepub fn set_content_search_spec<T>(self, v: T) -> Selfwhere
T: Into<ContentSearchSpec>,
pub fn set_content_search_spec<T>(self, v: T) -> Selfwhere
T: Into<ContentSearchSpec>,
Sets the value of content_search_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::ContentSearchSpec;
let x = SearchRequest::new().set_content_search_spec(ContentSearchSpec::default()/* use setters */);Sourcepub fn set_or_clear_content_search_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<ContentSearchSpec>,
pub fn set_or_clear_content_search_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<ContentSearchSpec>,
Sets or clears the value of content_search_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::ContentSearchSpec;
let x = SearchRequest::new().set_or_clear_content_search_spec(Some(ContentSearchSpec::default()/* use setters */));
let x = SearchRequest::new().set_or_clear_content_search_spec(None::<ContentSearchSpec>);Sourcepub fn set_safe_search<T: Into<bool>>(self, v: T) -> Self
pub fn set_safe_search<T: Into<bool>>(self, v: T) -> Self
Sourcepub fn set_user_labels<T, K, V>(self, v: T) -> Self
pub fn set_user_labels<T, K, V>(self, v: T) -> Self
Sets the value of user_labels.
§Example
let x = SearchRequest::new().set_user_labels([
("key0", "abc"),
("key1", "xyz"),
]);Sourcepub fn set_search_as_you_type_spec<T>(self, v: T) -> Selfwhere
T: Into<SearchAsYouTypeSpec>,
pub fn set_search_as_you_type_spec<T>(self, v: T) -> Selfwhere
T: Into<SearchAsYouTypeSpec>,
Sets the value of search_as_you_type_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::SearchAsYouTypeSpec;
let x = SearchRequest::new().set_search_as_you_type_spec(SearchAsYouTypeSpec::default()/* use setters */);Sourcepub fn set_or_clear_search_as_you_type_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<SearchAsYouTypeSpec>,
pub fn set_or_clear_search_as_you_type_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<SearchAsYouTypeSpec>,
Sets or clears the value of search_as_you_type_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::SearchAsYouTypeSpec;
let x = SearchRequest::new().set_or_clear_search_as_you_type_spec(Some(SearchAsYouTypeSpec::default()/* use setters */));
let x = SearchRequest::new().set_or_clear_search_as_you_type_spec(None::<SearchAsYouTypeSpec>);Sourcepub fn set_display_spec<T>(self, v: T) -> Selfwhere
T: Into<DisplaySpec>,
pub fn set_display_spec<T>(self, v: T) -> Selfwhere
T: Into<DisplaySpec>,
Sets the value of display_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::DisplaySpec;
let x = SearchRequest::new().set_display_spec(DisplaySpec::default()/* use setters */);Sourcepub fn set_or_clear_display_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<DisplaySpec>,
pub fn set_or_clear_display_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<DisplaySpec>,
Sets or clears the value of display_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::DisplaySpec;
let x = SearchRequest::new().set_or_clear_display_spec(Some(DisplaySpec::default()/* use setters */));
let x = SearchRequest::new().set_or_clear_display_spec(None::<DisplaySpec>);Sourcepub fn set_session<T: Into<String>>(self, v: T) -> Self
pub fn set_session<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_session_spec<T>(self, v: T) -> Selfwhere
T: Into<SessionSpec>,
pub fn set_session_spec<T>(self, v: T) -> Selfwhere
T: Into<SessionSpec>,
Sets the value of session_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::SessionSpec;
let x = SearchRequest::new().set_session_spec(SessionSpec::default()/* use setters */);Sourcepub fn set_or_clear_session_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<SessionSpec>,
pub fn set_or_clear_session_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<SessionSpec>,
Sets or clears the value of session_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::SessionSpec;
let x = SearchRequest::new().set_or_clear_session_spec(Some(SessionSpec::default()/* use setters */));
let x = SearchRequest::new().set_or_clear_session_spec(None::<SessionSpec>);Sourcepub fn set_relevance_threshold<T: Into<RelevanceThreshold>>(self, v: T) -> Self
pub fn set_relevance_threshold<T: Into<RelevanceThreshold>>(self, v: T) -> Self
Sets the value of relevance_threshold.
§Example
use google_cloud_discoveryengine_v1::model::search_request::RelevanceThreshold;
let x0 = SearchRequest::new().set_relevance_threshold(RelevanceThreshold::Lowest);
let x1 = SearchRequest::new().set_relevance_threshold(RelevanceThreshold::Low);
let x2 = SearchRequest::new().set_relevance_threshold(RelevanceThreshold::Medium);Sourcepub fn set_relevance_score_spec<T>(self, v: T) -> Selfwhere
T: Into<RelevanceScoreSpec>,
pub fn set_relevance_score_spec<T>(self, v: T) -> Selfwhere
T: Into<RelevanceScoreSpec>,
Sets the value of relevance_score_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::RelevanceScoreSpec;
let x = SearchRequest::new().set_relevance_score_spec(RelevanceScoreSpec::default()/* use setters */);Sourcepub fn set_or_clear_relevance_score_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<RelevanceScoreSpec>,
pub fn set_or_clear_relevance_score_spec<T>(self, v: Option<T>) -> Selfwhere
T: Into<RelevanceScoreSpec>,
Sets or clears the value of relevance_score_spec.
§Example
use google_cloud_discoveryengine_v1::model::search_request::RelevanceScoreSpec;
let x = SearchRequest::new().set_or_clear_relevance_score_spec(Some(RelevanceScoreSpec::default()/* use setters */));
let x = SearchRequest::new().set_or_clear_relevance_score_spec(None::<RelevanceScoreSpec>);Sourcepub fn set_ranking_expression<T: Into<String>>(self, v: T) -> Self
pub fn set_ranking_expression<T: Into<String>>(self, v: T) -> Self
Sets the value of ranking_expression.
§Example
let x = SearchRequest::new().set_ranking_expression("example");Sourcepub fn set_ranking_expression_backend<T: Into<RankingExpressionBackend>>(
self,
v: T,
) -> Self
pub fn set_ranking_expression_backend<T: Into<RankingExpressionBackend>>( self, v: T, ) -> Self
Sets the value of ranking_expression_backend.
§Example
use google_cloud_discoveryengine_v1::model::search_request::RankingExpressionBackend;
let x0 = SearchRequest::new().set_ranking_expression_backend(RankingExpressionBackend::RankByEmbedding);
let x1 = SearchRequest::new().set_ranking_expression_backend(RankingExpressionBackend::RankByFormula);Trait Implementations§
Source§impl Clone for SearchRequest
impl Clone for SearchRequest
Source§fn clone(&self) -> SearchRequest
fn clone(&self) -> SearchRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more