Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

GCP Retail API Filter is not working

idang
New Member

Hi there,

I was trying to use Search for Retail / Recommendations AI / Retail API (names keep changing), by importing the sample data for products, created a model for Similar Items and when trying to query, all works fine but once I add the filter it returns zero results, which not makes any sense:

 

 

{
    "filter": "brands: ANY(\"Google\")",
    "validateOnly": false,
    "userEvent": {
        "eventType": "detail-page-view",
        "visitorId": "8256a25c-7283-9b3c-01e6-92bb8307c72a",
        "productDetails": [
            {
                "product": {
                    "id": "GGCOGAEC100613"
                }
            }
        ]
    },
    "params": {
        "filterSyntaxV2": true
    }
}

 

 

And it returns:

 

 

{
    "attributionToken": "ChMyOTk4NTEyNTIwMjc3NDk1NTAzEAIaHHNpbV9zaW1pbGFyLWl0XzE3MTc0NzIxNDQ3MzYiBHRlc3QoADootPHREq3y0RL38dESsvHREozy0RL68dESj_LREqny0RK78tESvvLREg"
}

 

 

When removing the filter attribute it returns:

 

 

{
    "results": [
        {
            "id": "GGCOGAEC100616"
        },
        {
            "id": "GGOEGAER141013"
        }
    ],
    "attributionToken": "ChQxMjA0NzE5MDM1ODA5MjUxNTk2ORACGhxzaW1fc2ltaWxhci1pdF8xNzE3NDcyMTQ0NzM2IgR0ZXN0KAA6KLTx0RL38dESrfLRErLx0RKM8tES-vHREo_y0RKp8tESu_LREr7y0RI"
}

 

 

0 0 125
0 REPLIES 0