My curations are not working if I am passing a gro...
# community-help
s
My curations are not working if I am passing a group_by field in the search query. This issue has surfaced recently and was not the case in the past. Can someone help here?
This is not working
Copy code
curl --location 'https://xyz/collections/variantV2/documents/search?query_by=productTitle%2Chandle%2CnormalisedTags%2CcategoryName%2CsubCategory%2CbrandName%2CproductType%2Csize%2Ccolor%2Cshade%2Cvolume&q=Summer%20edit&per_page=100&page=1&facet_by=size%2Cshade%2Ccolor%2Cvolume%2CbrandName%2CproductType%2CnormalisedTags.*&group_by=visualOptionId&sortBy=popularity%3Adesc' \
--header 'X-TYPESENSE-API-KEY: xyz'
This is working
Copy code
curl --location 'https://xyz/collections/variantV2/documents/search?query_by=productTitle%2Chandle%2CnormalisedTags%2CcategoryName%2CsubCategory%2CbrandName%2CproductType%2Csize%2Ccolor%2Cshade%2Cvolume&q=Summer%20edit&per_page=100&page=1&facet_by=size%2Cshade%2Ccolor%2Cvolume%2CbrandName%2CproductType%2CnormalisedTags.*&sortBy=popularity%3Adesc' \
--header 'X-TYPESENSE-API-KEY: xyz'
f
Can you provide a simple set of curl commands with a sample dataset and the override like here for a reproducible example? It's really hard for us to debug this issue otherwise
a
Hi @Fanis Tharropoulos, sharing the example below - For curl, (This doesn't have group by clause)
Copy code
curl --location 'https://xyz/collections/variantV2/documents/search?query_by=productTitle%2Chandle%2CnormalisedTags%2CcategoryName%2CsubCategory%2CbrandName%2CproductType%2Csize%2Ccolor%2Cshade%2Cvolume&q=Summer%20edit&per_page=50&page=1&group_by=visualOptionId&sortBy=popularity%3Adesc' \
--header 'X-TYPESENSE-API-KEY: xyz'
Response -
Copy code
{
    "facet_counts": [],
    "found": 93,
    "hits": [
        {
            "curated": true,
            "document": {
                "available": true,
                "brandId": "67ff8656fcd4b11401a0522f",
                "brandName": "Anasi",
                "categoryId": "670014c073fb1b5ab9355639",
                "categoryName": "Fashion",
                "compareAtPrice": 0.0,
                "description": "<p><strong>Product Description </strong></p>\n<p>Introducing our Kai Midi Dress In a majestic shade of magenta pink. Adorned with a mesmerizing Ikat print, this dress captures the essence of bohemian charm. The cross-knot detailing in the front adds a contemporary twist, accentuating your curves.</p>\n<p>Ikkat Print.</p>\n<p>Colour - Magenta pink</p>\n<p>Washing Instructions - Dry Clean</p>",
                "externalProductId": "7948593660098",
                "externalVariantId": "44554104930498",
                "featuredImage": "https://cdn.shopify.com/s/files/1/0567/1111/9042/files/KEW1550copy.jpg?v=1748352362",
                "handle": "kai-maxi-dress",
                "id": "68137a57d3ca5a65e684470c-68137a57d3ca5a65e6844770",
                "images": [
                    "https://cdn.shopify.com/s/files/1/0567/1111/9042/files/KEW1550copy.jpg?v=1716304104",
                    "https://cdn.shopify.com/s/files/1/0567/1111/9042/files/KEW1585copy.jpg?v=1716304097",
                    "https://cdn.shopify.com/s/files/1/0567/1111/9042/files/KEW1545copy.jpg?v=1716304097"
                ],
                "normalisationConfidence": 0.85,
                "normalisedTags": {
                    "Gender": [
                        "Women"
                    ],
                    "Neckline": [
                        "V Neck"
                    ],
                    "Print Type": [
                        "Printed"
                    ],
                    "Style Type": [
                        "Casual",
                        "Beach wear"
                    ]
                },
                "options": {
                    "size": "XXXL"
                },
                "price": 3500.0,
                "productId": "68137a57d3ca5a65e684470c",
                "productTitle": "Kai Midi Dress",
                "productType": "Midi Dress",
                "publishedAt": "2024-05-21T20:38:36+05:30",
                "publishedAtEpoch": 1749292201029,
                "shopifyProductId": 7948593660098,
                "shopifyVariantId": 44554104930498,
                "size": "XXXL",
                "sku": "ANS-DR-004-XXXL",
                "subCategory": "Dresses",
                "tags": [
                    "__label:Best Seller",
                    "Bestsellers",
                    "collection-ss24"
                ],
                "title": "XXXL",
                "updatedAt": "2025-06-07T10:30:01.029494212",
                "updatedAtEpoch": 1749292201029,
                "variantId": "68137a57d3ca5a65e6844770",
                "vendor": "Anasiclothing",
                "visualOptionId": "7948593660098-X"
            },
            "highlight": {},
            "highlights": []
        },
        {
            "curated": true,
            "document": {
                "available": true,
                "brandId": "67ff8656fcd4b11401a0522f",
                "brandName": "Anasi",
                "categoryId": "670014c073fb1b5ab9355639",
                "categoryName": "Fashion",
                "compareAtPrice": 0.0,
                "description": "<p><strong>Product Description </strong></p>\n<p>Introducing our Elle Co-ord Set, The blouse features intricate micro handmade pleats, enhancing the rich Ikat print, while the multi-layered skirt adds a playful, feminine touch. Adorned with delicate lacy detailing on the edges, this set in vibrant magenta exudes sophistication. </p>\n<p>Top with Maxi Skirt.</p>\n<p>Ikat Print</p>\n<p>Colour - Magenta</p>\n<p>Washing Instructions - Dry Clean</p>",
                "externalProductId": "7948597231810",
                "externalVariantId": "44554123280578",
                "featuredImage": "https://cdn.shopify.com/s/files/1/0567/1111/9042/files/KEW1718copy.jpg?v=1748352271",
                "handle": "elle-co-ord-set-ikat-print",
                "id": "68137a57d3ca5a65e684471f-68137a57d3ca5a65e68448d0",
                "images": [
                    "https://cdn.shopify.com/s/files/1/0567/1111/9042/files/KEW1718copy.jpg?v=1715943106",
                    "https://cdn.shopify.com/s/files/1/0567/1111/9042/files/KEW1731copy.jpg?v=1715943106"
                ],
                "normalisationConfidence": 0.9,
                "normalisedTags": {
                    "Gender": [
                        "Women"
                    ],
                    "Material/Fabric": [
                        "Cotton"
                    ],
                    "Print Type": [
                        "Printed"
                    ],
                    "Style Type": [
                        "Festive",
                        "Traditional"
                    ]
                },
                "options": {
                    "size": "XXXL",
                    "style": "Skirts"
                },
                "price": 3300.0,
                "productId": "68137a57d3ca5a65e684471f",
                "productTitle": "Elle Co-ord Set",
                "productType": "Skirt Sets",
                "publishedAt": "2024-05-17T23:13:25+05:30",
                "publishedAtEpoch": 1749292232446,
                "shopifyProductId": 7948597231810,
                "shopifyVariantId": 44554123280578,
                "size": "XXXL",
                "sku": "ANS-CRDST-011",
                "subCategory": "Co-ords",
                "tags": [
                    "__label:Best Seller",
                    "Bestsellers",
                    "collection-ss24"
                ],
                "title": "XXXL / Skirts",
                "updatedAt": "2025-06-07T10:30:32.446657889",
                "updatedAtEpoch": 1749292232446,
                "variantId": "68137a57d3ca5a65e68448d0",
                "vendor": "Anasiclothing",
                "visualOptionId": "7948597231810-skirts"
            },
            "highlight": {},
            "highlights": []
        },
    "out_of": 175332,
    "page": 1,
    "request_params": {
        "collection_name": "variantV2",
        "first_q": "Summer edit",
        "per_page": 50,
        "q": "Summer edit"
    },
    "search_cutoff": false,
    "search_time_ms": 42
}
For curl, (This has group by clause)
Copy code
curl --location 'https://xyz/collections/variantV2/documents/search?query_by=productTitle%2Chandle%2CnormalisedTags%2CcategoryName%2CsubCategory%2CbrandName%2CproductType%2Csize%2Ccolor%2Cshade%2Cvolume&q=Summer%20edit&per_page=50&page=1&group_by=visualOptionId&sortBy=popularity%3Adesc' \
--header 'X-TYPESENSE-API-KEY: xyz'
Response - Sharing below
Copy code
{
    "facet_counts": [],
    "found": 2,
    "found_docs": 72,
    "grouped_hits": [
        {
            "found": 64,
            "group_key": [
                "8315780661411-X"
            ],
            "hits": [
                {
                    "document": {
                        "available": true,
                        "brandId": "67ed426f0b279121fd19c25f",
                        "brandName": "Inspirit Store",
                        "categoryId": "670014c073fb1b5ab9355639",
                        "categoryName": "Fashion",
                        "compareAtPrice": 4100.0,
                        "description": "<div class=\"flex-shrink-0 flex flex-col relative items-end\" data-mce-fragment=\"1\">\n<div data-mce-fragment=\"1\">\n<div class=\"pt-0.5\" data-mce-fragment=\"1\">\n<div class=\"gizmo-shadow-stroke flex h-6 w-6 items-center justify-center overflow-hidden rounded-full\" data-mce-fragment=\"1\">\n<div class=\"relative p-1 rounded-sm h-9 w-9 text-white flex items-center justify-center\" data-mce-fragment=\"1\"><br data-mce-fragment=\"1\"></div>\n</div>\n</div>\n</div>\n</div>\n<div class=\"relative flex w-full flex-col agent-turn\" data-mce-fragment=\"1\">\n<div class=\"flex-col gap-1 md:gap-3\" data-mce-fragment=\"1\">\n<div class=\"flex flex-grow flex-col max-w-full\" data-mce-fragment=\"1\">\n<div data-message-author-role=\"assistant\" data-message-id=\"490dc39e-3759-4fee-acae-e70b3e54eade\" class=\"min-h-[20px] text-message flex flex-col items-start gap-3 whitespace-pre-wrap break-words [.text-message+&]:mt-5 overflow-x-auto\" data-mce-fragment=\"1\">\n<div class=\"markdown prose w-full break-words dark:prose-invert light\" data-mce-fragment=\"1\">\n<p data-mce-fragment=\"1\">Introducing the Viscos Haldi Pink Set, a three-piece ensemble that radiates charm and elegance in every stitch. Designed for those who appreciate the beauty of traditional attire with a modern twist, this set is a perfect blend of comfort, style, and cultural significance.</p>\n<p data-mce-fragment=\"1\"><strong data-mce-fragment=\"1\">Features:</strong></p>\n<p data-mce-fragment=\"1\"><strong data-mce-fragment=\"1\">Luxurious Viscos Fabric:</strong> Crafted from premium Viscos fabric, this set promises not only a stunning visual appeal with its vibrant Haldi pink hue but also unparalleled comfort. The fabric's smooth texture ensures a graceful drape that complements every figure.</p>\n</div>\n</div>\n</div>\n</div>\n</div>",
                        "externalProductId": "8315780661411",
                        "externalVariantId": "44300180029603",
                        "featuredImage": "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/9B3365A0-44FE-43C6-B2FE-88544B581CAC.jpg?v=1722343460",
                        "handle": "haldi-pink-co-ord-set-summer-edition",
                        "id": "68137990d3ca5a65e684255e-68137990d3ca5a65e68425c1",
                        "images": [
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/9B3365A0-44FE-43C6-B2FE-88544B581CAC.jpg?v=1722343460",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/6F3FDABE-F868-450B-AF00-4F048C575C55.jpg?v=1722331046",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/8A34DFC6-B305-46AA-90C3-9C74ECD2C689.jpg?v=1722331050",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/9B0811C9-7E65-4979-BB23-F21B58D1E226.jpg?v=1722331053",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/16C4F585-1B8C-4CC7-BDDA-38DE44B6297E.jpg?v=1722331066",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/35D46FDB-2CDD-4964-AF08-BC34D8F3730E.jpg?v=1722331071",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/50C90A2A-4710-4177-9BE3-EFF4515718F3.jpg?v=1722331086",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/AEA5D725-1838-4D66-9859-2EECF292DD6B.jpg?v=1722331098",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/CCA25269-A54C-4FA0-A8DA-CB04E97D66E4.jpg?v=1722343545",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/DB42AF9E-E28C-43D6-844C-E269864C6169.jpg?v=1722331124",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/DD68156F-6160-4D76-93A5-80D426922186.jpg?v=1722331133",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/IMG_5879.heic?v=1712907471",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/sizechart_e2522045-bcda-42ac-b994-c529eeb94c03.png?v=1712907471",
                            "https://cdn.shopify.com/s/files/1/0632/9866/6659/files/IMG_5885.heic?v=1712907404"
                        ],
                        "normalisationConfidence": 0.85,
                        "normalisedTags": {
                            "Fit": [
                                "Relaxed"
                            ],
                            "Gender": [
                                "Women"
                            ],
                            "Material/Fabric": [
                                "Polyster"
                            ],
                            "Print Type": [
                                "Solid"
                            ],
                            "Style Type": [
                                "Traditional",
                                "Casual"
                            ]
                        },
                        "options": {
                            "coat + inner size": "4XL",
                            "pant size": "XS"
                        },
                        "price": 3299.0,
                        "productId": "68137990d3ca5a65e684255e",
                        "productTitle": "Haldi Pink Co-ord Set (Summer Edition)",
                        "productType": "Trouser Sets",
                        "publishedAt": "2024-04-09T18:58:04+05:30",
                        "publishedAtEpoch": 1749268863798,
                        "shopifyProductId": 8315780661411,
                        "shopifyVariantId": 44300180029603,
                        "sku": "",
                        "subCategory": "Co-ords",
                        "tags": [],
                        "title": "4XL / XS",
                        "updatedAt": "2025-06-07T04:01:03.798724583",
                        "updatedAtEpoch": 1749268863798,
                        "variantId": "68137990d3ca5a65e68425c1",
                        "vendor": "Inspirit Store",
                        "visualOptionId": "8315780661411-X"
                    },
                    "highlight": {
                        "productTitle": {
                            "matched_tokens": [
                                "Summer",
                                "Edit"
                            ],
                            "snippet": "Haldi Pink Co-ord Set (<mark>Summer</mark> <mark>Edit</mark>ion)"
                        }
                    },
                    "highlights": [
                        {
                            "field": "productTitle",
                            "matched_tokens": [
                                "Summer",
                                "Edit"
                            ],
                            "snippet": "Haldi Pink Co-ord Set (<mark>Summer</mark> <mark>Edit</mark>ion)"
                        }
                    ],
                    "text_match": 1157451437081362553,
                    "text_match_info": {
                        "best_field_score": "2211881091072",
                        "best_field_weight": 15,
                        "fields_matched": 1,
                        "num_tokens_dropped": 0,
                        "score": "1157451437081362553",
                        "tokens_matched": 2,
                        "typo_prefix_score": 1
                    }
                }
],
    "out_of": 175332,
    "page": 1,
    "request_params": {
        "collection_name": "variantV2",
        "first_q": "Summer edit",
        "per_page": 50,
        "q": "Summer edit"
    },
    "search_cutoff": false,
    "search_time_ms": 3
}
Shared only few documents because of long text constraint
So, just to summarise, without group_by clause, I'm getting curated response. Can see it in response as wel(curated: true) but with group by, curation is not working
f
What's the override?
s
image.png,image.png
f
Can you share your cluster's ID in DM? I'll take a look myself