#community-help

Using Distinct Filter without Grouping in Event Ticketing System

TLDR Michael sought a way to use a distinct filter without grouping in their event ticketing system. Kishore Nallan suggested a yet-to-be-released join-like feature.

Powered by Struct AI

1

Jul 06, 2023 (3 months ago)
Michael
Photo of md5-f930fdb99fd46477205fa1201164ea50
Michael
01:23 AM
Hi everyone, is there a way to use a distinct filter without grouping? As in, I only want to get the first result where a field is duplicated
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:54 AM
Yes, set group_limit: 1
Michael
Photo of md5-f930fdb99fd46477205fa1201164ea50
Michael
02:13 AM
Thanks Kishore - but I want to avoid grouping where possible, just want to remove duplicates and return distinct items
02:13
Michael
02:13 AM
Adding some context:
02:17
Michael
02:17 AM
I have an event ticketing system where users have "Events" and then each event can have "Sessions"...

e.g. "Taylor Swift Tour" is the event, and then "New York Show", "Sydney Show"

I want users to be able to search for the session, but return the event and session together.. also linked to their geography...

e.g. If the user lives in New York and searches Taylor Swift - they will get Taylor Swift Tour - New York, but if they search Taylor Swift Sydney, the sort naturally brings the New York to the top

In the search, I only ever want to return one "Taylor Swift Tour" event at a time
02:19
Michael
02:19 AM
This message contains interactive elements.
Image 1 for This message contains interactive elements.
02:20
Michael
02:20 AM
This message contains interactive elements.
Image 1 for This message contains interactive elements.
02:21
Michael
02:21 AM
So I'm flattening the Events and Sessions into one schema "events"
02:21
Michael
02:21 AM
But the group_by field forces the eventId to be a facet, which it really shouldn't be
02:22
Michael
02:22 AM
Where really I just want to return the top performing result for each eventId
02:22
Michael
02:22 AM
Appreciate your help Kishore Nallan (sorry about the message spam)
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:48 AM
What you probably need a join like feature here. We are actively working on this and will have something to share in a week or so.

1

Michael
Photo of md5-f930fdb99fd46477205fa1201164ea50
Michael
02:51 AM
Awesome, glad to hear!