Reference documentation and code samples for the Google Cloud Retail V2 Client class QueryExpansionSpec.
Specification to determine under which conditions query expansion should
occur.
Generated from protobuf messagegoogle.cloud.retail.v2.SearchRequest.QueryExpansionSpec
Namespace
Google \ Cloud \ Retail \ V2 \ SearchRequest
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ condition
int
The condition under which query expansion should occur. Default toCondition.DISABLED.
↳ pin_unexpanded_results
bool
Whether to pin unexpanded results. The default value is false. If this field is set to true, unexpanded products are always at the top of the search results, followed by the expanded results.
getCondition
The condition under which query expansion should occur. Default toCondition.DISABLED.
Returns
Type
Description
int
setCondition
The condition under which query expansion should occur. Default toCondition.DISABLED.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getPinUnexpandedResults
Whether to pin unexpanded results. The default value is false. If this
field is set to true,
unexpanded products are always at the top of the search results, followed
by the expanded results.
Returns
Type
Description
bool
setPinUnexpandedResults
Whether to pin unexpanded results. The default value is false. If this
field is set to true,
unexpanded products are always at the top of the search results, followed
by the expanded results.
[[["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 QueryExpansionSpec (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.SearchRequest.QueryExpansionSpec)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.SearchRequest.QueryExpansionSpec)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.SearchRequest.QueryExpansionSpec)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.SearchRequest.QueryExpansionSpec)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.SearchRequest.QueryExpansionSpec)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.SearchRequest.QueryExpansionSpec)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.SearchRequest.QueryExpansionSpec)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.SearchRequest.QueryExpansionSpec)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.SearchRequest.QueryExpansionSpec)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.SearchRequest.QueryExpansionSpec)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.SearchRequest.QueryExpansionSpec)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.SearchRequest.QueryExpansionSpec)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.SearchRequest.QueryExpansionSpec) \nReference documentation and code samples for the Google Cloud Retail V2 Client class QueryExpansionSpec.\n\nSpecification to determine under which conditions query expansion should\noccur.\n\nGenerated from protobuf message `google.cloud.retail.v2.SearchRequest.QueryExpansionSpec`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2 \\\\ SearchRequest\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getCondition\n\nThe condition under which query expansion should occur. Default to\n[Condition.DISABLED](/php/docs/reference/cloud-retail/latest/V2.SearchRequest.QueryExpansionSpec.Condition#_Google_Cloud_Retail_V2_SearchRequest_QueryExpansionSpec_Condition__DISABLED).\n\n### setCondition\n\nThe condition under which query expansion should occur. Default to\n[Condition.DISABLED](/php/docs/reference/cloud-retail/latest/V2.SearchRequest.QueryExpansionSpec.Condition#_Google_Cloud_Retail_V2_SearchRequest_QueryExpansionSpec_Condition__DISABLED).\n\n### getPinUnexpandedResults\n\nWhether to pin unexpanded results. The default value is false. If this\nfield is set to true,\nunexpanded products are always at the top of the search results, followed\nby the expanded results.\n\n### setPinUnexpandedResults\n\nWhether to pin unexpanded results. The default value is false. If this\nfield is set to true,\nunexpanded products are always at the top of the search results, followed\nby the expanded results."]]