#community-help

Using Alphabetical Sorting Feature with Typesense-InstantSearch-Adapter

TLDR Jan inquired about using the alphabetical sorting feature with the typesense-instantsearch-adapter. Jason clarified that the feature is available from version 0.26.0.rc.

Powered by Struct AI

1

Oct 04, 2023 (2 months ago)
Jan
Photo of md5-79fc728f0635dc2218142cb603ce2570
Jan
01:13 PM
Hi! We are looking forward to start using the option for sort facet values based on their names (instead of counts)
I’m looking at the github issue [NEW Feature]Sorting facets alphabetically #521 Does this work with the typesense-instantsearch-adapter?
Currently I’m doing it like this with typesense-instantsearrch-adapter. Will the sortBy option work when version 0.26 is available?
        refinementList({
            container: '#relevant-gdpr-articles',
            attribute: 'relevant_gdpr_articles',
            operator: 'and',
            searchable: 'true',
            limit: 0,
            sortBy: ['name:asc'],
       
        }),

Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:15 PM
The sortBy inside refinementList is client-side sorting done by the widget.

To get Typesense to sort facets alphabetically on the server side, you'd need to set sort_by in additionalSearchParameters when instantiating the typesense-instantsearch-adapter.
Jan
Photo of md5-79fc728f0635dc2218142cb603ce2570
Jan
01:17 PM
ok thanks!
01:17
Jan
01:17 PM
And this is available from 0.26.0.RC version?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:18 PM
Yeah, 0.26.0.rc22 is the latest RC as of today, but it has a known performance regression when using group_by. We're working on addressing that
Jan
Photo of md5-79fc728f0635dc2218142cb603ce2570
Jan
01:19 PM
Thanks. We are currently using v0.25.2.rc1 it’s not added to that version I guess?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:21 PM
Correct, it's only available in 0.26.0.rc
Jan
Photo of md5-79fc728f0635dc2218142cb603ce2570
Jan
01:23 PM
🙏
01:23
Jan
01:23 PM
thanks

1

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community

Similar Threads

Query on Facet Values, `max_facet_values` , and `facet_query_num_typos`.

Jan asked about sorting facet values, managing `max_facet_values` and issues with `facet_query_num_typos`. Jason clarified the details on instantsearch widget handling of `max_facet_values` and identified a bug on the Typesense Server. Jason suggested a solution to the sorting issue.

2

23
1mo

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.

11

70
4mo

Diacritics Support in Instantsearch.js RefinementList

Jan queries about enabling special characters in instantsearch.js refinementList. Kishore Nallan admits diacritics support exists for text searches, promising to look into supporting it in query fields. After claiming a fix, Jan later reports issues post-upgrade, which Jason & Kishore Nallan promise to resolve.

1

25
3w

Resolving 'stores_count' field sorting issue in Schema

em1nos encountered an issue sorting the 'stores_count' field, which was due to a field disparity in multiple collections. Upon resolving that, a subsequent issue with instant search internally managing sorting came up, which Jason addressed by releasing an updated version of the adapter.

5

41
31mo

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`.

1

6
28mo