#community-help

Constructing Unique Queries for Ecommerce Store

TLDR David asked how to construct unique queries in an ecommerce store. John suggested using group_by=brand and group_limit=1 for desired results.

Powered by Struct AI

3

3
6mo
Solved
Join the chat
May 31, 2023 (6 months ago)
David
Photo of md5-07c4f1bfa85fc4a2759ba7302f0b86da
David
10:05 AM
Is it possible to construct unique by queries? For example, picture an ecommerce store. I'd like to get 4 search hits from a specific category, but only one of each product name. So if I'm selling phones, instead of getting
1. Apple iPhone 12
2. Apple iPhone 13
3. Apple iPhone 14
4. Samsung Galaxy S23
I'd like to get
1. Apple iPhone 12
2. Samsung Galaxy S23
3. Google Pixel 6a
4. OnePlus 11
(Apple, Samsung, Google, OnePlus would be of a key named "brand" that I'd like the results to be uniq by)
John
Photo of md5-21545f1facb7836c149bc4c70752bd2b
John
10:17 AM
yeah, you can do group_by=brand and group_limit=1 to get one from each group

3

Jun 02, 2023 (6 months ago)
David
Photo of md5-07c4f1bfa85fc4a2759ba7302f0b86da
David
06:50 AM
Thank you John!