Typesense Facet Sorting When Counts Are Equal
TLDR Pedro inquired about sorting facets when counts are the same. Kishore Nallan explained it uses internal ID and directed to an existing GitHub issue discussing alphabetical ordering.
May 17, 2023 (4 months ago)
Pedro
09:46 AMHP has 20, Logitech Creators has 17 and TP-Link has 17. When I make a search and display the facet Brand, the order of the list is HP, then Logitech Creators or TP-Link. Because Logitech Creators and TP-Link have the same count.
What I want to understand is how does typesense decide which brand should come first in the list, in case they have the same count. And if there is a way to change that order.
Thank you.
Kishore Nallan
10:35 AMKishore Nallan
10:35 AMMay 18, 2023 (4 months ago)
Pedro
09:39 AMKishore Nallan
09:44 AMPedro
03:00 PMKishore Nallan
03:06 PMMay 19, 2023 (4 months ago)
Pedro
09:06 AMKishore Nallan
09:07 AMPedro
09:31 AMTypesense
Indexed 2779 threads (79% resolved)
Similar Threads
Typesense Filter Ranking and User-Specific Filters
Pramit inquires about filter ranking in Typesense. Kishore Nallan explains filters are ranked by count, with no secondary sorting option. However, secondary sorting is on their roadmap, and client-side sorting is suggested for now.
Resolve Facets and Sorting Issues with Typesense
Ethan needed assistance with getting all facet values and sorting results by date using Typesense. Jason provided guidance on how to use Typesense properties to accomplish these tasks, and resolved issues related to specific use-cases provided by Ethan and Rushil.
Typesense Ecommerce Storefront Showcase Discussion
Mica discussed enhancements and filters for an ecommerce storefront using Typesense. Jason offered resources on filters and handling facets count issues reported by Claudiu. Jason also implemented a solution to fix the problem.
Setting Alphabetical Ordering for Facets in Typesense
Sean inquired about setting the ordering of a facet to alphabetical in Typesense. Jason suggested using `transformItems` or a normal JS array sort on `items`.
Facet Count Discrepancy in Integration Testing with Typesense
SamHendley faced an issue with inconsistent facet counts and found it was due to mixed case input and punctuation. Kishore Nallan confirmed that Typesense normalizes values before indexing, affecting the facet count. They then discussed addition of preconditioning data to match Typesense.