Action Input: The request query and filter that are applied to the
retrieved products, in addition to any filters already provided with the
SearchRequest. The AND operator is used to combine the query's existing
filters with the filter rule(s). NOTE: May result in 0 results when
filters conflict.
Action Result: Filters the returned objects to be ONLY those that passed
the filter.
Generated from protobuf message google.cloud.retail.v2.Rule.FilterAction
Namespace
Google \ Cloud \ Retail \ V2 \ Rule
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ filter
string
A filter to apply on the matching condition results. Supported features: * * filter must be set. * * Filter syntax is identical to SearchRequest.filter. For more information, see Filter. * * To filter products with product ID "product_1" or "product_2", and color "Red" or "Blue": (id: ANY("product_1", "product_2")) AND (colorFamilies: ANY("Red", "Blue"))
getFilter
A filter to apply on the matching condition results. Supported features:
To filter products with product ID "product_1" or "product_2", and
color
"Red" or "Blue": (id: ANY("product_1", "product_2")) AND (colorFamilies: ANY("Red", "Blue"))
Returns
Type
Description
string
setFilter
A filter to apply on the matching condition results. Supported features:
To filter products with product ID "product_1" or "product_2", and
color
"Red" or "Blue": (id: ANY("product_1", "product_2")) AND (colorFamilies: ANY("Red", "Blue"))
[[["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-09 UTC."],[],[],null,["# Google Cloud Retail V2 Client - Class FilterAction (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.Rule.FilterAction)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.Rule.FilterAction)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.Rule.FilterAction)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.Rule.FilterAction)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.Rule.FilterAction)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.Rule.FilterAction)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.Rule.FilterAction)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.Rule.FilterAction)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.Rule.FilterAction)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.Rule.FilterAction)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.Rule.FilterAction)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.Rule.FilterAction)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.Rule.FilterAction) \nReference documentation and code samples for the Google Cloud Retail V2 Client class FilterAction.\n\n- Rule Condition:\n\n - No [Condition.query_terms](/php/docs/reference/cloud-retail/latest/V2.Condition#_Google_Cloud_Retail_V2_Condition__getQueryTerms__) provided is a global match.\n- 1 or more\n [Condition.query_terms](/php/docs/reference/cloud-retail/latest/V2.Condition#_Google_Cloud_Retail_V2_Condition__getQueryTerms__)\n provided are combined with OR operator.\n\n- Action Input: The request query and filter that are applied to the retrieved products, in addition to any filters already provided with the SearchRequest. The AND operator is used to combine the query's existing filters with the filter rule(s). NOTE: May result in 0 results when filters conflict.\n- Action Result: Filters the returned objects to be ONLY those that passed the filter.\n\nGenerated from protobuf message `google.cloud.retail.v2.Rule.FilterAction`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2 \\\\ Rule\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getFilter\n\nA filter to apply on the matching condition results. Supported features:\n\n- [filter](/php/docs/reference/cloud-retail/latest/V2.Rule.FilterAction#_Google_Cloud_Retail_V2_Rule_FilterAction__getFilter__) must be set.\n\n- Filter syntax is identical to\n [SearchRequest.filter](/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getFilter__). For\n more\n information, see [Filter](/retail/docs/filter-and-order#filter).\n\n- To filter products with product ID \"product_1\" or \"product_2\", and color \"Red\" or \"Blue\": \n *(id: ANY(\"product_1\", \"product_2\"))* *AND* *(colorFamilies: ANY(\"Red\", \"Blue\"))*\n\n### setFilter\n\nA filter to apply on the matching condition results. Supported features:\n\n- [filter](/php/docs/reference/cloud-retail/latest/V2.Rule.FilterAction#_Google_Cloud_Retail_V2_Rule_FilterAction__getFilter__) must be set.\n\n- Filter syntax is identical to\n [SearchRequest.filter](/php/docs/reference/cloud-retail/latest/V2.SearchRequest#_Google_Cloud_Retail_V2_SearchRequest__getFilter__). For\n more\n information, see [Filter](/retail/docs/filter-and-order#filter).\n\n- To filter products with product ID \"product_1\" or \"product_2\", and color \"Red\" or \"Blue\": \n *(id: ANY(\"product_1\", \"product_2\"))* *AND* *(colorFamilies: ANY(\"Red\", \"Blue\"))*"]]