Sorting within Group_by with Group_limit
TLDR Morgan wants to sort within groups after grouping, Kishore Nallan offers advice and validates. Proposed solutions do not guarantee prioritizing inStock
within groups.
Dec 21, 2021 (25 months ago)
Morgan
03:58 PMgroup_by
and group_limit
flag, is there any way to sort inside the group so we can use group_limit
to just get the few entries we need?Kishore Nallan
04:02 PMMorgan
04:05 PMsort_by
is used to sort the result. which can be tricky because the default search result sequence seems to be based on matching. exact match always comes first, but when using sort_by, that sequence is disrupted.Kishore Nallan
04:07 PMMorgan
04:08 PMgroup_limit
. I use the shoe example in the document, group_by=brand&group_limit=3
returns certain brands and limit 3, but what if I want to have a the first 3 to favor in_stock
? something like group_by=brand&group_limit=3&group_sort_by:inStock:desc
would helpKishore Nallan
04:10 PMsort_by=inStock:desc
then even within the group the top-3 items based on inStock
only will be picked I think. But maybe I am wrong.Morgan
04:12 PMKishore Nallan
04:13 PMsort_by=_text_match:desc,inStock:desc
Kishore Nallan
04:13 PMMorgan
04:14 PMupdates: that seemed working for me. I will play and see.
_
_text_match
works but looks like we still cannot get the inStock
first in each group. After all, sort_by=_text_match:desc,inStock:desc
works after 3 entries are taken from each group. The 3 entries taken are not guaranteed to have favored inStock
.Typesense
Indexed 3011 threads (79% resolved)
Similar Threads
Document Weighting and Sorting Discussion
SamHendley asked how to weight a document based on age and offered a sorting method. Jason clarified the method and suggested an RC for use. SamHendley tested and confirmed the solution. User Kishore Nallan assisted when an error occurred with a new feature.
Configuring InstantSearch.js Parameters and Comparing Search Results
John is having difficulty configuring InstantSearch.js parameters. Jason suggested how to utilize `facet_by` and `filter_by` widgets and advised checking network for search parameters. They also asked John to open an issue on the unexpected need for manual `_text_match` addition.
Tuning Query Results Order with Query_by_Weights
Nathan is trying to tune the order of results using `query_by_weights`, but experiences a smaller impact than expected. Jason suggests trying `max_weight` and sharing a snippet to further investigate.
Solving Conflicts in Searching and Ordering Data with Typesense
SamHendley faced an issue with search result order in Typesense. Kishore Nallan explained two behaviors that affected the ranking and pledged to change these, while also considering an additional suggestion from SamHendley. These changes were implemented in version `0.24.0.rcn39`.
Issues With `text_match` Scoring for Search Queries in Typesense
Colin encountered issues with the `text_match` scoring on Typesense v0.23.1. Jason and Kishore Nallan identified a potential issue with numeric overflow in the text match score and applied an unverified patch. The final resolution is unclear.