Li Yuxuan
08/22/2025, 10:12 AM[
{
screenId: "screen_a",
ui_elements: [
{
groupId: "group:button:1",
class: "button",
},
{
groupId: "group:button:1",
class: "button",
},
{
groupId: "group:icon:1",
class: "icon",
},
],
embedding: [...]
},
{
screenId: "screen_b",
ui_elements: [
{
groupId: "group:button:1",
class: "button",
},
{
groupId: "group:icon:1",
class: "icon",
},
],
embedding: [...]
},
{
screenId: "screen_c",
ui_elements: [
{
groupId: "group:button:1",
class: "button",
},
{
groupId: "group:button:2",
class: "button",
},
{
groupId: "group:icon:1",
class: "icon",
},
],
embedding: [...]
},
{
screenId: "screen_d",
ui_elements: [
{
groupId: "group:icon:1",
class: "icon",
},
],
embedding: [...]
},
];
Can I search for documents that:
• contain both button
& icon
• and in my search results, screen_a
and screen_b
are de-duplicated to only show 1 (since they both contain the same type of elements)
I'm thinking of using embedding
field as you can see above, to be used to de-duplicate similar screens instead of based on the element groupings, is that possible with TypeSense APIs? 🙏Fanis Tharropoulos
08/22/2025, 12:24 PMLi Yuxuan
08/22/2025, 2:34 PMgroup_by=ui_elements.groupId
it shows me the grouping key is the whole array like ["group:button:1","group:button:2","group:icon:1"]
Li Yuxuan
08/22/2025, 2:34 PMLi Yuxuan
08/22/2025, 2:35 PMFanis Tharropoulos
08/25/2025, 10:30 AMgroupId
(or however you want to define similarity), and select the best candidate from each group. Maybe based on which screen has more unique UI element types, or by using the embedding
field for semantic similarity.Li Yuxuan
08/25/2025, 10:33 AM