Ashutosh
04/21/2025, 4:10 PMKishore Nallan
04/21/2025, 4:16 PMAshutosh
04/21/2025, 4:20 PM"XYZ"
, to always show up at the top, even if they have 0 matched parts.
Why?
XYZ is a preferred/internal supplier, so I want to give them priority visibility β even when they donβt have any parts for this particular order.
1. XYZ β 0 parts matched πΌ (forced to top)
2. ABC β 15 parts matched
3. DEF β 10 parts matchedAshutosh
04/21/2025, 4:21 PMAshutosh
04/21/2025, 4:22 PMKishore Nallan
04/21/2025, 4:27 PMAshutosh
04/21/2025, 4:29 PMKishore Nallan
04/21/2025, 4:31 PMYou can also sort facets on the value of a sibling field like this: recipe.name(sort_by: recipe.calories:asc)
Here, the recipe
is an object and name
and calories
are field inside the object. While faceting on receipe.name
you can sort on calories
(useful in diet apps). However, I am not sure how we break the tie if 2 facets have the same calorie values. I suspect we could allow falling back to counts on tie. If we do this, you can set a preferred
boolean flag and use this to sort those preferred suppliers to the top.Ashutosh
04/21/2025, 4:59 PM[supplierInfo]
Because ur example i am getting that i can sort on particular Object value of facet, but cant pin.
So i have a question if i put "XYZ" preferred value to 100. and other to 0.
so will it come on top and remaining will come based on count sort, preferred 0 wont affect the earlier responses?Kishore Nallan
04/21/2025, 5:03 PMAshutosh
04/21/2025, 5:05 PMAshutosh
04/21/2025, 5:05 PMKishore Nallan
04/21/2025, 5:17 PMKishore Nallan
04/21/2025, 5:17 PMAshutosh
04/21/2025, 6:40 PMAshutosh
04/21/2025, 6:40 PMKishore Nallan
04/23/2025, 3:19 AMAshutosh
04/23/2025, 5:40 AM