- Resource: Evaluation
- EvaluationSpec
- SearchRequest
- ImageQuery
- DataStoreSpec
- BoostSpec
- ConditionBoostSpec
- BoostControlSpec
- AttributeType
- InterpolationType
- ControlPoint
- FacetSpec
- FacetKey
- Interval
- QueryExpansionSpec
- Condition
- SpellCorrectionSpec
- Mode
- EmbeddingSpec
- EmbeddingVector
- RankingExpressionBackend
- NaturalLanguageQueryUnderstandingSpec
- FilterExtractionCondition
- ExtractedFilterBehavior
- SearchAsYouTypeSpec
- Condition
- DisplaySpec
- MatchHighlightingCondition
- SessionSpec
- RelevanceThreshold
- RelevanceScoreSpec
- QuerySetSpec
- QualityMetrics
- TopkMetrics
- State
- Methods
Resource: Evaluation
An evaluation is a single execution (or run) of an evaluation process. It encapsulates the state of the evaluation and the resulting data.
JSON representation |
---|
{ "name" : string , "evaluationSpec" : { object ( |
Fields | |
---|---|
name
|
Identifier. The full resource name of the This field must be a UTF-8 encoded string with a length limit of 1024 characters. |
evaluationSpec
|
Required. The specification of the evaluation. |
qualityMetrics
|
Output only. The metrics produced by the evaluation, averaged across all Only populated when the evaluation's state is SUCCEEDED. |
state
|
Output only. The state of the evaluation. |
error
|
Output only. The error that occurred during evaluation. Only populated when the evaluation's state is FAILED. |
createTime
|
Output only. Timestamp the Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
endTime
|
Output only. Timestamp the Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
errorSamples[]
|
Output only. A sample of errors encountered while processing the request. |
EvaluationSpec
Describes the specification of the evaluation.
JSON representation |
---|
{ "querySetSpec" : { object ( |
querySetSpec
object (
QuerySetSpec
)
Optional. The specification of the query set.
search_spec
. The search specification. search_spec
can be only one of the following:searchRequest
object (
SearchRequest
)
Required. The search request that is used to perform the evaluation.
Only the following fields within SearchRequest are supported; if any other fields are provided, an UNSUPPORTED error will be returned:
SearchRequest
Request message for SearchService.Search
method.
JSON representation |
---|
{ "servingConfig" : string , "branch" : string , "query" : string , "imageQuery" : { object ( |
servingConfig
string
Required. 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
string
The 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
string
Raw search query.
imageQuery
object (
ImageQuery
)
Raw image query.
pageSize
integer
Maximum number of Document
s 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.
pageToken
string
A 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
oneBoxPageSize
integer
The maximum number of results to return for OneBox. This applies to each OneBox type individually. Default number is 10.
dataStoreSpecs[]
object (
DataStoreSpec
)
Specifications that define the specific DataStore
s to be searched, along with configurations for those data stores. This is only considered for Engine
s with multiple data stores. For engines with a single data store, the specs directly under SearchRequest
should be used.
filter
string
The 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
canonicalFilter
string
The 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
.
orderBy
string
The order in which documents are returned. Documents can be ordered by a field in an Document
object. Leave it unset if ordered by relevance. orderBy
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.
userInfo
object (
UserInfo
)
Information about the end user. Highly recommended for analytics and personalization. UserInfo.user_agent
is used to deduce deviceType
for analytics.
languageCode
string
The 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.
regionCode
string
The Unicode country/region code (CLDR) of a location, such as "US" and "419". For more information, see Standard fields . If set, then results will be boosted based on the regionCode provided.
facetSpecs[]
object (
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.
boostSpec
params
map (key: string, value: value (
Value
format))
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
-
searchType
: 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,searchType: 1
queryExpansionSpec
object (
QueryExpansionSpec
)
The query expansion specification that specifies the conditions under which query expansion occurs.
spellCorrectionSpec
object (
SpellCorrectionSpec
)
The spell correction specification that specifies the mode under which spell correction takes effect.
userPseudoId
string
A 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.
contentSearchSpec
object (
ContentSearchSpec
)
A specification for configuring the behavior of content search.
rankingExpression
string
Optional. The ranking expression controls the customized ranking on retrieval documents. This overrides ServingConfig.ranking_expression
. The syntax and supported features depend on the rankingExpressionBackend
value. If rankingExpressionBackend
is not provided, it defaults to RANK_BY_EMBEDDING
.
If rankingExpressionBackend
is not provided or set to RANK_BY_EMBEDDING
, it should be a single function or multiple functions that are joined by "+".
- rankingExpression = function, { " + ", function };
Supported functions:
- double * relevanceScore
- double * dotProduct(embedding_field_path)
Function variables:
-
relevanceScore
: 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_path
and query embedding vector.
Example ranking expression:
If document has an embedding field doc_embedding, the ranking expression could be 0.5 * relevanceScore + 0.3 * dotProduct(doc_embedding)
.
If rankingExpressionBackend
is set to RANK_BY_FORMULA
, the following expression types (and combinations of those chained using + or * operators) are supported:
-
double
-
signal
-
log(signal)
-
exp(signal)
-
rr(signal, double > 0)
-- reciprocal rank transformation with second argument being a denominator constant. -
isNan(signal)
-- returns 0 if signal is NaN, 1 otherwise. -
fillNan(signal1, signal2 | double)
-- if signal1 is NaN, returns signal2 | double, else returns signal1.
Here are a few examples of ranking formulas that use the supported ranking expression types:
-
0.2 * semanticSimilarityScore + 0.8 * log(keywordSimilarityScore)
-- mostly rank by the logarithm ofkeywordSimilarityScore
with slightsemantic_smilarity_score
adjustment. -
0.2 * exp(fillNan(semanticSimilarityScore, 0)) + 0.3 * isNan(keywordSimilarityScore)
-- rank by the exponent ofsemanticSimilarityScore
filling the value with 0 if it's NaN, also add constant 0.3 adjustment to the final score ifsemanticSimilarityScore
is NaN. -
0.2 * rr(semanticSimilarityScore, 16) + 0.8 * rr(keywordSimilarityScore, 16)
-- mostly rank by the reciprocal rank ofkeywordSimilarityScore
with slight adjustment of reciprocal rank ofsemantic_smilarity_score
.
The following signals are supported:
-
semanticSimilarityScore
: 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. -
keywordSimilarityScore
: 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. -
relevanceScore
: 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. -
pctrRank
: 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. -
freshnessRank
: freshness adjustment as a rank -
documentAge
: The time in hours elapsed since the document was last updated, a floating-point number (e.g., 0.25 means 15 minutes). -
topicalityRank
: topicality adjustment as a rank. uses proprietary Google model to determine the keyword-based overlap between the query and the document. -
baseRank
: the default rank of the result
rankingExpressionBackend
enum (
RankingExpressionBackend
)
Optional. The backend to use for the ranking expression evaluation.
safeSearch
boolean
Whether to turn on safe search. This is only supported for website search.
userLabels
map (key: string, value: 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.
naturalLanguageQueryUnderstandingSpec
object (
NaturalLanguageQueryUnderstandingSpec
)
Config for natural language query understanding capabilities, such as extracting structured field filters from the query. Refer to this documentation
for more information. If naturalLanguageQueryUnderstandingSpec
is not specified, no additional natural language query understanding will be done.
searchAsYouTypeSpec
object (
SearchAsYouTypeSpec
)
Search as you type configuration. Only supported for the IndustryVertical.MEDIA
vertical.
displaySpec
object (
DisplaySpec
)
Optional. Config for display feature, like match highlighting on search results.
session
string
The 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.
sessionSpec
relevanceThreshold
enum (
RelevanceThreshold
)
The 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.
personalizationSpec
object (
PersonalizationSpec
)
The specification for personalization.
Notice that if both ServingConfig.personalization_spec
and SearchRequest.personalization_spec
are set, SearchRequest.personalization_spec
overrides ServingConfig.personalization_spec
.
relevanceScoreSpec
object (
RelevanceScoreSpec
)
Optional. The specification for returning the relevance score.
ImageQuery
Specifies the image query input.
JSON representation |
---|
{ // Union field |
Union field image
.
image
can be only one of the following:
imageBytes
string
Base64 encoded image bytes. Supported image formats: JPEG, PNG, and BMP.
DataStoreSpec
A struct to define data stores to filter on in a search call and configurations for those data stores. Otherwise, an INVALID_ARGUMENT
error is returned.
JSON representation |
---|
{
"dataStore"
:
string
,
"filter"
:
string
,
"boostSpec"
:
{
object (
|
Fields | |
---|---|
dataStore
|
Required. Full resource name of |
filter
|
Optional. Filter specification to filter documents in the data store specified by dataStore field. For more information on filtering, see Filtering |
boostSpec
|
Optional. Boost specification to boost certain documents. For more information on boosting, see Boosting |
customSearchOperators
|
Optional. Custom search operators which if specified will be used to filter results from workspace data stores. For more information on custom search operators, see SearchOperators . |
BoostSpec
Boost specification to boost certain documents.
JSON representation |
---|
{
"conditionBoostSpecs"
:
[
{
object (
|
Fields | |
---|---|
conditionBoostSpecs[]
|
Condition boost specifications. If a document matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20. |
ConditionBoostSpec
Boost applies to documents which match a condition.
JSON representation |
---|
{
"condition"
:
string
,
"boost"
:
number
,
"boostControlSpec"
:
{
object (
|
condition
string
An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter
for detail syntax and limitations.
Examples:
- To boost documents with document ID "doc_1" or "doc_2", and color "Red" or "Blue":
(documentId: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))
boost
number
Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0.
Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents.
Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely.
Setting to 0.0 means no boost applied. The boosting condition is ignored. Only one of the (condition, boost) combination or the boostControlSpec below are set. If both are set then the global boost is ignored and the more fine-grained boostControlSpec is applied.
boostControlSpec
object (
BoostControlSpec
)
Complex specification for custom ranking based on customer defined attribute value.
BoostControlSpec
Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above.
JSON representation |
---|
{ "fieldName" : string , "attributeType" : enum ( |
Fields | |
---|---|
fieldName
|
The name of the field whose value will be used to determine the boost amount. |
attributeType
|
The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified fieldName. In the case of numerical it is straightforward i.e. attributeValue = numerical_field_value. In the case of freshness however, attributeValue = (time.now() - datetime_field_value). |
interpolationType
|
The interpolation type to be applied to connect the control points listed below. |
controlPoints[]
|
The control points used to define the curve. The monotonic function (defined through the interpolationType above) passes through the control points listed here. |
AttributeType
The attribute(or function) for which the custom ranking is to be applied.
Enums | |
---|---|
ATTRIBUTE_TYPE_UNSPECIFIED
|
Unspecified AttributeType. |
NUMERICAL
|
The value of the numerical field will be used to dynamically update the boost amount. In this case, the attributeValue (the x value) of the control point will be the actual value of the numerical field for which the boostAmount is specified. |
FRESHNESS
|
For the freshness use case the attribute value will be the duration between the current time and the date in the datetime field specified. The value must be formatted as an XSD dayTimeDuration
value (a restricted subset of an ISO 8601 duration value). The pattern for this is: [nD][T[nH][nM][nS]]
. For example, 5D
, 3DT12H30M
, T24H
. |
InterpolationType
The interpolation type to be applied. Default will be linear (Piecewise Linear).
Enums | |
---|---|
INTERPOLATION_TYPE_UNSPECIFIED
|
Interpolation type is unspecified. In this case, it defaults to Linear. |
LINEAR
|
Piecewise linear interpolation will be applied. |
ControlPoint
The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
JSON representation |
---|
{ "attributeValue" : string , "boostAmount" : number } |
Fields | |
---|---|
attributeValue
|
Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD |
boostAmount
|
The value between -1 to 1 by which to boost the score if the attributeValue evaluates to the value specified above. |
FacetSpec
A facet specification to perform faceted search.
JSON representation |
---|
{
"facetKey"
:
{
object (
|
facetKey
object (
FacetKey
)
Required. The facet key specification.
limit
integer
Maximum facet values that are returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 are coerced to 300. For aggregation in healthcare search, when the [FacetKey.key] is "healthcare_aggregation_key", the limit will be overridden to 10,000 internally, regardless of the value set here.
If this field is negative, an INVALID_ARGUMENT
is returned.
excludedFilterKeys[]
string
List of keys to exclude when faceting.
By default, FacetKey.key
is not excluded from the filter unless it is listed in this field.
Listing a facet key in this field allows its values to appear as facet results, even when they are filtered out of search results. Using this field does not affect what search results are returned.
For example, suppose there are 100 documents with the color facet "Red" and 200 documents with the color facet "Blue". A query containing the filter "color:ANY("Red")" and having "color" as FacetKey.key
would by default return only "Red" documents in the search results, and also return "Red" with count 100 as the only color facet. Although there are also blue documents available, "Blue" would not be shown as an available facet value.
If "color" is listed in "excludedFilterKeys", then the query returns the facet values "Red" with count 100 and "Blue" with count 200, because the "color" key is now excluded from the filter. Because this field doesn't affect search results, the search results are still correctly filtered to return only "Red" documents.
A maximum of 100 values are allowed. Otherwise, an INVALID_ARGUMENT
error is returned.
enableDynamicPosition
boolean
Enables dynamic position for this facet. If set to true, the position of this facet among all facets in the response is determined automatically. If dynamic facets are enabled, it is ordered together. If set to false, the position of this facet in the response is the same as in the request, and it is ranked before the facets with dynamic position enable and all dynamic facets.
For example, you may always want to have rating facet returned in the response, but it's not necessarily to always display the rating facet at the top. In that case, you can set enableDynamicPosition to true so that the position of rating facet in response is determined automatically.
Another example, assuming you have the following facets in the request:
-
"rating", enableDynamicPosition = true
-
"price", enableDynamicPosition = false
-
"brands", enableDynamicPosition = false
And also you have a dynamic facets enabled, which generates a facet gender
. Then the final order of the facets in the response can be ("price", "brands", "rating", "gender") or ("price", "brands", "gender", "rating") depends on how API orders "gender" and "rating" facets. However, notice that "price" and "brands" are always ranked at first and second position because their enableDynamicPosition is false.
FacetKey
Specifies how a facet is computed.
JSON representation |
---|
{
"key"
:
string
,
"intervals"
:
[
{
object (
|
key
string
Required. Supported textual and numerical facet keys in Document
object, over which the facet values are computed. Facet key is case-sensitive.
intervals[]
object (
Interval
)
Set only if values should be bucketed into intervals. Must be set for facets with numerical values. Must not be set for facet with text values. Maximum number of intervals is 30.
restrictedValues[]
string
Only get facet for the given restricted values. Only supported on textual fields. For example, suppose "category" has three values "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set "restrictedValues" to "Action > 2022", the "category" facet only contains "Action > 2022". Only supported on textual fields. Maximum is 10.
prefixes[]
string
Only get facet values that start with the given string prefix. For example, suppose "category" has three values "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the "category" facet only contains "Action > 2022" and "Action > 2021". Only supported on textual fields. Maximum is 10.
contains[]
string
Only get facet values that contain the given strings. For example, suppose "category" has three values "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the "category" facet only contains "Action > 2022" and "Sci-Fi > 2022". Only supported on textual fields. Maximum is 10.
caseInsensitive
boolean
True to make facet keys case insensitive when getting faceting values with prefixes or contains; false otherwise.
orderBy
string
The order in which documents are returned.
Allowed values are:
-
"count desc", which means order by
SearchResponse.Facet.values.count
descending. -
"value desc", which means order by
SearchResponse.Facet.values.value
descending. Only applies to textual facets.
If not set, textual values are sorted in natural order
; numerical intervals are sorted in the order given by FacetSpec.FacetKey.intervals
.
Interval
A floating point interval.
JSON representation |
---|
{ // Union field |
Union field min
. The lower bound of the interval. If neither of the min fields are set, then the lower bound is negative infinity.
This field must be not larger than max. Otherwise, an INVALID_ARGUMENT
error is returned. min
can be only one of the following:
minimum
number
Inclusive lower bound.
exclusiveMinimum
number
Exclusive lower bound.
Union field max
. The upper bound of the interval. If neither of the max fields are set, then the upper bound is positive infinity.
This field must be not smaller than min. Otherwise, an INVALID_ARGUMENT
error is returned. max
can be only one of the following:
maximum
number
Inclusive upper bound.
exclusiveMaximum
number
Exclusive upper bound.
QueryExpansionSpec
Specification to determine under which conditions query expansion should occur.
JSON representation |
---|
{
"condition"
:
enum (
|
Fields | |
---|---|
condition
|
The condition under which query expansion should occur. Default to |
pinUnexpandedResults
|
Whether to pin unexpanded results. If this field is set to true, unexpanded products are always at the top of the search results, followed by the expanded results. |
Condition
Enum describing under which condition query expansion should occur.
Enums | |
---|---|
CONDITION_UNSPECIFIED
|
Unspecified query expansion condition. In this case, server behavior defaults to Condition.DISABLED
. |
DISABLED
|
Disabled query expansion. Only the exact search query is used, even if SearchResponse.total_size
is zero. |
AUTO
|
Automatic query expansion built by the Search API. |
SpellCorrectionSpec
The specification for query spell correction.
JSON representation |
---|
{
"mode"
:
enum (
|
Fields | |
---|---|
mode
|
The mode under which spell correction replaces the original search query. Defaults to |
Mode
Enum describing under which mode spell correction should occur.
Enums | |
---|---|
MODE_UNSPECIFIED
|
Unspecified spell correction mode. In this case, server behavior defaults to Mode.AUTO
. |
SUGGESTION_ONLY
|
Search API tries to find a spelling suggestion. If a suggestion is found, it is put in the SearchResponse.corrected_query
. The spelling suggestion won't be used as the search query. |
AUTO
|
Automatic spell correction built by the Search API. Search will be based on the corrected query if found. |
EmbeddingSpec
The specification that uses customized query embedding vector to do semantic document retrieval.
JSON representation |
---|
{
"embeddingVectors"
:
[
{
object (
|
Fields | |
---|---|
embeddingVectors[]
|
The embedding vector used for retrieval. Limit to 1. |
EmbeddingVector
Embedding vector.
JSON representation |
---|
{ "fieldPath" : string , "vector" : [ number ] } |
Fields | |
---|---|
fieldPath
|
Embedding field path in schema. |
vector[]
|
Query embedding vector. |
RankingExpressionBackend
The backend to use for the ranking expression evaluation.
Enums | |
---|---|
RANKING_EXPRESSION_BACKEND_UNSPECIFIED
|
Default option for unspecified/unknown values. |
BYOE
|
Deprecated: Use |
CLEARBOX
|
Deprecated: Use |
RANK_BY_EMBEDDING
|
Ranking by custom embedding model, the default way to evaluate the ranking expression. |
RANK_BY_FORMULA
|
Ranking by custom formula. |
NaturalLanguageQueryUnderstandingSpec
Specification to enable natural language understanding capabilities for search requests.
JSON representation |
---|
{ "filterExtractionCondition" : enum ( |
Fields | |
---|---|
filterExtractionCondition
|
The condition under which filter extraction should occur. Server behavior defaults to |
geoSearchQueryDetectionFieldNames[]
|
Field names used for location-based filtering, where geolocation filters are detected in natural language search queries. Only valid when the FilterExtractionCondition is set to If this field is set, it overrides the field names set in |
extractedFilterBehavior
|
Optional. Controls behavior of how extracted filters are applied to the search. The default behavior depends on the request. For single datastore structured search, the default is |
FilterExtractionCondition
Enum describing under which condition filter extraction should occur.
Enums | |
---|---|
CONDITION_UNSPECIFIED
|
Server behavior defaults to DISABLED
. |
DISABLED
|
Disables NL filter extraction. |
ENABLED
|
Enables NL filter extraction. |
ExtractedFilterBehavior
Enum describing how extracted filters are applied to the search.
Enums | |
---|---|
EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED
|
EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED
will use the default behavior for extracted filters. For single datastore search, the default is to apply as hard filters. For multi-datastore search, the default is to apply as soft boosts. |
HARD_FILTER
|
Applies all extracted filters as hard filters on the results. Results that do not pass the extracted filters will not be returned in the result set. |
SOFT_BOOST
|
Applies all extracted filters as soft boosts. Results that pass the filters will be boosted up to higher ranks in the result set. |
SearchAsYouTypeSpec
Specification for search as you type in search requests.
JSON representation |
---|
{
"condition"
:
enum (
|
Fields | |
---|---|
condition
|
The condition under which search as you type should occur. Default to |
Condition
Enum describing under which condition search as you type should occur.
Enums | |
---|---|
CONDITION_UNSPECIFIED
|
Server behavior defaults to Condition.DISABLED
. |
DISABLED
|
Disables Search As You Type. |
ENABLED
|
Enables Search As You Type. |
AUTO
|
Automatic switching between search-as-you-type and standard search modes, ideal for single-API implementations (e.g., debouncing). |
DisplaySpec
Specifies features for display, like match highlighting.
JSON representation |
---|
{
"matchHighlightingCondition"
:
enum (
|
Fields | |
---|---|
matchHighlightingCondition
|
The condition under which match highlighting should occur. |
MatchHighlightingCondition
Enum describing under which condition match highlighting should occur.
Enums | |
---|---|
MATCH_HIGHLIGHTING_CONDITION_UNSPECIFIED
|
Server behavior is the same as MATCH_HIGHLIGHTING_DISABLED
. |
MATCH_HIGHLIGHTING_DISABLED
|
Disables match highlighting on all documents. |
MATCH_HIGHLIGHTING_ENABLED
|
Enables match highlighting on all documents. |
SessionSpec
Session specification.
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.
JSON representation |
---|
{ "queryId" : string , "searchResultPersistenceCount" : integer } |
Fields | |
---|---|
queryId
|
If set, the search result gets stored to the "turn" specified by this query ID. Example: Let's say the session looks like this: session { name: ".../sessions/xxx" turns { query { text: "What is foo?" queryId: ".../questions/yyy" } answer: "Foo is ..." } turns { query { text: "How about bar then?" queryId: ".../questions/zzz" } } } The user can call /search API with a request like this: session: ".../sessions/xxx" sessionSpec { queryId: ".../questions/zzz" } Then, the API stores the search result, associated with the last turn. The stored search result can be used by a subsequent /answer API call (with the session ID and the query ID specified). Also, it is possible to call /search and /answer in parallel with the same session ID & query ID. |
searchResultPersistenceCount
|
The number of top search results to persist. The persisted search results can be used for the subsequent /answer api call. This field is similar to the At most 10 results for documents mode, or 50 for chunks mode. |
RelevanceThreshold
The relevance threshold of the search results. The higher relevance threshold is, the higher relevant results are shown and the less number of results are returned.
Enums | |
---|---|
RELEVANCE_THRESHOLD_UNSPECIFIED
|
Default value. In this case, server behavior defaults to Google defined threshold. |
LOWEST
|
Lowest relevance threshold. |
LOW
|
Low relevance threshold. |
MEDIUM
|
Medium relevance threshold. |
HIGH
|
High relevance threshold. |
RelevanceScoreSpec
The specification for returning the document relevance score.
JSON representation |
---|
{ "returnRelevanceScore" : boolean } |
Fields | |
---|---|
returnRelevanceScore
|
Optional. Whether to return the relevance score for search results. The higher the score, the more relevant the document is to the query. |
QuerySetSpec
Describes the specification of the query set.
JSON representation |
---|
{ "sampleQuerySet" : string } |
Fields | |
---|---|
sampleQuerySet
|
Optional. The full resource name of the |
QualityMetrics
Describes the metrics produced by the evaluation.
JSON representation |
---|
{ "docRecall" : { object ( |
Fields | |
---|---|
docRecall
|
Recall per document, at various top-k cutoff levels. Recall is the fraction of relevant documents retrieved out of all relevant documents. Example (top-5): * For a single |
docPrecision
|
Precision per document, at various top-k cutoff levels. Precision is the fraction of retrieved documents that are relevant. Example (top-5): * For a single |
docNdcg
|
Normalized discounted cumulative gain (NDCG) per document, at various top-k cutoff levels. NDCG measures the ranking quality, giving higher relevance to top results. Example (top-3): Suppose Retrieved: [D3 (0), D1 (1), D2 (1)] Ideal: [D1 (1), D2 (1), D3 (0)] Calculate NDCG@3
for each |
pageRecall
|
Recall per page, at various top-k cutoff levels. Recall is the fraction of relevant pages retrieved out of all relevant pages. Example (top-5): * For a single |
pageNdcg
|
Normalized discounted cumulative gain (NDCG) per page, at various top-k cutoff levels. NDCG measures the ranking quality, giving higher relevance to top results. Example (top-3): Suppose Retrieved: [P3 (0), P1 (1), P2 (1)] Ideal: [P1 (1), P2 (1), P3 (0)] Calculate NDCG@3
for |
TopkMetrics
Stores the metric values at specific top-k levels.
JSON representation |
---|
{ "top1" : number , "top3" : number , "top5" : number , "top10" : number } |
Fields | |
---|---|
top1
|
The top-1 value. |
top3
|
The top-3 value. |
top5
|
The top-5 value. |
top10
|
The top-10 value. |
State
Describes the state of an evaluation.
Enums | |
---|---|
STATE_UNSPECIFIED
|
The evaluation is unspecified. |
PENDING
|
The service is preparing to run the evaluation. |
RUNNING
|
The evaluation is in progress. |
SUCCEEDED
|
The evaluation completed successfully. |
FAILED
|
The evaluation failed. |
Methods |
|
---|---|
|
Creates a Evaluation
. |
|
Gets a Evaluation
. |
|
Gets a list of Evaluation
s. |
|
Gets a list of results for a given a Evaluation
. |