The estimated total count of matched items irrespective of pagination. The count ofresultsreturned by pagination may be less than thetotal_sizethat matches.
↳ corrected_query
string
Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.
↳ attribution_token
string
A unique search token. This should be included in theUserEventlogs resulting from this search, which enables accurate attribution of search model performance.
↳ next_page_token
string
A token that can be sent asSearchRequest.page_tokento retrieve the next page. If this field is omitted, there are no subsequent pages.
Query expansion information for the returned results.
↳ redirect_uri
string
The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and onlyredirect_uriandattribution_tokenare set in the response.
↳ applied_controls
array
The fully qualified resource name of appliedcontrols.
Metadata for pin controls which were applicable to the request. This contains two map fields, one for all matched pins and one for pins which were matched but not applied. The two maps are keyed by pin position, and the values are the product ids which were matched to that pin.
The estimated total count of matched items irrespective of pagination. The
count ofresultsreturned
by pagination may be less than thetotal_sizethat
matches.
Returns
Type
Description
int
setTotalSize
The estimated total count of matched items irrespective of pagination. The
count ofresultsreturned
by pagination may be less than thetotal_sizethat
matches.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getCorrectedQuery
Contains the spell corrected query, if found. If the spell correction type
is AUTOMATIC, then the search results are based on corrected_query.
Otherwise the original query is used for search.
Returns
Type
Description
string
setCorrectedQuery
Contains the spell corrected query, if found. If the spell correction type
is AUTOMATIC, then the search results are based on corrected_query.
Otherwise the original query is used for search.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getAttributionToken
A unique search token. This should be included in theUserEventlogs resulting from this
search, which enables accurate attribution of search model performance.
Returns
Type
Description
string
setAttributionToken
A unique search token. This should be included in theUserEventlogs resulting from this
search, which enables accurate attribution of search model performance.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getNextPageToken
A token that can be sent asSearchRequest.page_tokento retrieve the next page. If this field is omitted, there are no
subsequent pages.
Returns
Type
Description
string
setNextPageToken
A token that can be sent asSearchRequest.page_tokento retrieve the next page. If this field is omitted, there are no
subsequent pages.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getQueryExpansionInfo
Query expansion information for the returned results.
The URI of a customer-defined redirect page. If redirect action is
triggered, no search is performed, and onlyredirect_uriandattribution_tokenare set in the response.
Returns
Type
Description
string
setRedirectUri
The URI of a customer-defined redirect page. If redirect action is
triggered, no search is performed, and onlyredirect_uriandattribution_tokenare set in the response.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getAppliedControls
The fully qualified resource name of appliedcontrols.
The fully qualified resource name of appliedcontrols.
Parameter
Name
Description
var
string[]
Returns
Type
Description
$this
getPinControlMetadata
Metadata for pin controls which were applicable to the request.
This contains two map fields, one for all matched pins and one for pins
which were matched but not applied.
The two maps are keyed by pin position, and the values are the product ids
which were matched to that pin.
Metadata for pin controls which were applicable to the request.
This contains two map fields, one for all matched pins and one for pins
which were matched but not applied.
The two maps are keyed by pin position, and the values are the product ids
which were matched to that pin.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Retail V2 Client - Class SearchResponse (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.SearchResponse)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.SearchResponse)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.SearchResponse)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.SearchResponse)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.SearchResponse)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.SearchResponse)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.SearchResponse)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.SearchResponse)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.SearchResponse)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.SearchResponse)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.SearchResponse)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.SearchResponse)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.SearchResponse) \nReference documentation and code samples for the Google Cloud Retail V2 Client class SearchResponse.\n\nResponse message for\n[SearchService.Search](/php/docs/reference/cloud-retail/latest/V2.Client.SearchServiceClient#_Google_Cloud_Retail_V2_Client_SearchServiceClient__search__) method.\n\nGenerated from protobuf message `google.cloud.retail.v2.SearchResponse`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getResults\n\nA list of matched items. The order represents the ranking.\n\n### setResults\n\nA list of matched items. The order represents the ranking.\n\n### getFacets\n\nResults of facets requested by user.\n\n### setFacets\n\nResults of facets requested by user.\n\n### getTotalSize\n\nThe estimated total count of matched items irrespective of pagination. The\ncount of [results](/php/docs/reference/cloud-retail/latest/V2.SearchResponse#_Google_Cloud_Retail_V2_SearchResponse__getResults__) returned\nby pagination may be less than the\n[total_size](/php/docs/reference/cloud-retail/latest/V2.SearchResponse#_Google_Cloud_Retail_V2_SearchResponse__getTotalSize__) that\nmatches.\n\n### setTotalSize\n\nThe estimated total count of matched items irrespective of pagination. The\ncount of [results](/php/docs/reference/cloud-retail/latest/V2.SearchResponse#_Google_Cloud_Retail_V2_SearchResponse__getResults__) returned\nby pagination may be less than the\n[total_size](/php/docs/reference/cloud-retail/latest/V2.SearchResponse#_Google_Cloud_Retail_V2_SearchResponse__getTotalSize__) that\nmatches.\n\n### getCorrectedQuery\n\nContains the spell corrected query, if found. If the spell correction type\nis AUTOMATIC, then the search results are based on corrected_query.\n\nOtherwise the original query is used for search.\n\n### setCorrectedQuery\n\nContains the spell corrected query, if found. If the spell correction type\nis AUTOMATIC, then the search results are based on corrected_query.\n\nOtherwise the original query is used for search.\n\n### getAttributionToken\n\nA unique search token. This should be included in the\n[UserEvent](/php/docs/reference/cloud-retail/latest/V2.UserEvent) logs resulting from this\nsearch, which enables accurate attribution of search model performance.\n\n### setAttributionToken\n\nA unique search token. This should be included in the\n[UserEvent](/php/docs/reference/cloud-retail/latest/V2.UserEvent) logs resulting from this\nsearch, which enables accurate attribution of search model performance.\n\n### getNextPageToken\n\nA token that can be sent as\n[SearchRequest.page_token](/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getPageToken__)\nto retrieve the next page. If this field is omitted, there are no\nsubsequent pages.\n\n### setNextPageToken\n\nA token that can be sent as\n[SearchRequest.page_token](/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getPageToken__)\nto retrieve the next page. If this field is omitted, there are no\nsubsequent pages.\n\n### getQueryExpansionInfo\n\nQuery expansion information for the returned results.\n\n### hasQueryExpansionInfo\n\n### clearQueryExpansionInfo\n\n### setQueryExpansionInfo\n\nQuery expansion information for the returned results.\n\n### getRedirectUri\n\nThe URI of a customer-defined redirect page. If redirect action is\ntriggered, no search is performed, and only\n[redirect_uri](/php/docs/reference/cloud-retail/latest/V2.SearchResponse#_Google_Cloud_Retail_V2_SearchResponse__getRedirectUri__) and\n[attribution_token](/php/docs/reference/cloud-retail/latest/V2.SearchResponse#_Google_Cloud_Retail_V2_SearchResponse__getAttributionToken__)\nare set in the response.\n\n### setRedirectUri\n\nThe URI of a customer-defined redirect page. If redirect action is\ntriggered, no search is performed, and only\n[redirect_uri](/php/docs/reference/cloud-retail/latest/V2.SearchResponse#_Google_Cloud_Retail_V2_SearchResponse__getRedirectUri__) and\n[attribution_token](/php/docs/reference/cloud-retail/latest/V2.SearchResponse#_Google_Cloud_Retail_V2_SearchResponse__getAttributionToken__)\nare set in the response.\n\n### getAppliedControls\n\nThe fully qualified resource name of applied\n[controls](https://cloud.google.com/retail/docs/serving-control-rules).\n\n### setAppliedControls\n\nThe fully qualified resource name of applied\n[controls](https://cloud.google.com/retail/docs/serving-control-rules).\n\n### getPinControlMetadata\n\nMetadata for pin controls which were applicable to the request.\n\nThis contains two map fields, one for all matched pins and one for pins\nwhich were matched but not applied.\nThe two maps are keyed by pin position, and the values are the product ids\nwhich were matched to that pin.\n\n### hasPinControlMetadata\n\n### clearPinControlMetadata\n\n### setPinControlMetadata\n\nMetadata for pin controls which were applicable to the request.\n\nThis contains two map fields, one for all matched pins and one for pins\nwhich were matched but not applied.\nThe two maps are keyed by pin position, and the values are the product ids\nwhich were matched to that pin.\n\n### getInvalidConditionBoostSpecs\n\nThe invalid\n[SearchRequest.BoostSpec.condition_boost_specs](/php/docs/reference/cloud-retail/latest/V2.SearchRequest.BoostSpec#_Google_Cloud_Retail_V2_SearchRequest_BoostSpec__getConditionBoostSpecs__)\nthat are not applied during serving.\n\n### setInvalidConditionBoostSpecs\n\nThe invalid\n[SearchRequest.BoostSpec.condition_boost_specs](/php/docs/reference/cloud-retail/latest/V2.SearchRequest.BoostSpec#_Google_Cloud_Retail_V2_SearchRequest_BoostSpec__getConditionBoostSpecs__)\nthat are not applied during serving.\n\n### getExperimentInfo\n\nMetadata related to A/B testing experiment associated with this\nresponse. Only exists when an experiment is triggered.\n\n### setExperimentInfo\n\nMetadata related to A/B testing experiment associated with this\nresponse. Only exists when an experiment is triggered.\n\n### getConversationalSearchResult\n\nThis field specifies all related information that is needed on client\nside for UI rendering of conversational retail search.\n\n### hasConversationalSearchResult\n\n### clearConversationalSearchResult\n\n### setConversationalSearchResult\n\nThis field specifies all related information that is needed on client\nside for UI rendering of conversational retail search.\n\n### getTileNavigationResult\n\nThis field specifies all related information for tile navigation that will\nbe used in client side.\n\n### hasTileNavigationResult\n\n### clearTileNavigationResult\n\n### setTileNavigationResult\n\nThis field specifies all related information for tile navigation that will\nbe used in client side."]]