Slackbot
10/26/2023, 12:40 PMJason Bosco
10/26/2023, 4:19 PMmax_facet_values is controlled by the instantsearch widgets, so you want to use the limit and showMoreLimit props for refinementList to control this value via instantsearchJason Bosco
10/26/2023, 4:20 PMfacet_by is also overridden by Instantsearch... and I'm not sure how to best handle this, given that Algolia does not support changing the server-side sort order like we do in Typesense at runtime.
Could you try setting attribute: 'relevant_gdpr_articles(sort_by: _alpha:asc)' in the refinementList prop?Jason Bosco
10/26/2023, 4:22 PMfacet_query_num_typos is fine to place in additionalSearchParameters... I suspect it will start working once we figure the above outJan Willem Hoogstraten
10/26/2023, 6:35 PMlimit: 0 in the refinementList because we don’t want to show any facets before the user starts searching for facets. (we also see a performance improvement if we set limit:0 Changing limit and adding showMoreLimit unfortunately won’t help us in this case.
For your understanding/context: our refinementList filter contains all GDPR chapters, articles and sub-articles (e.g. Article 8, Article 8(1), Article 8(2) etc.). So that’s why we don’t want to show anything by default, need all facets to be ordered by alpha:asc (and not count).
Setting this attribute didn’t do anything unfortunately relevant_gdpr_articles(sort_by: _alpha:asc)
facet_query_num_typos works 👍 but the alpha sort is what I’m looking for to make our use-case work.Jason Bosco
10/26/2023, 8:07 PMshowMoreLimit to 999 and setting limit: 0 handle your use-case for max facet values?Jason Bosco
10/26/2023, 9:07 PMv2.8.0-1 of typesense-instantsearch-adapter, I've added the ability to pass in options into facet_by. Here's how to use it:
https://github.com/typesense/typesense-instantsearch-adapter#setting-facet_by-optionsJan Willem Hoogstraten
10/27/2023, 8:59 AMJan Willem Hoogstraten
10/27/2023, 9:02 AMv2.8.0-1 and added this to the typesenseInstantsearchAdapter config:
facetByOptions: {
relevant_gdpr_articles: "(sort_by: _alpha:desc)",
},
But when I use the facet search it doesn’t work and I see this error
Error: 400 - Facet query refers to a facet field `relevant_gdpr_articles` that is not part of `facet_by` parameter.Jan Willem Hoogstraten
10/27/2023, 9:30 AM999 that helped! But without the alpha sorting it’s still not usable for our users.Jason Bosco
10/27/2023, 1:59 PMJan Willem Hoogstraten
10/27/2023, 2:26 PMJason Bosco
10/27/2023, 3:08 PMJason Bosco
10/27/2023, 3:24 PMJason Bosco
10/27/2023, 3:43 PM0.26.0.rc26, you shouldn't see this error any moreJan Willem Hoogstraten
10/27/2023, 7:02 PMJan Willem Hoogstraten
10/27/2023, 7:06 PMJason Bosco
10/27/2023, 7:10 PMJason Bosco
10/27/2023, 7:11 PMJason Bosco
10/27/2023, 7:12 PMJan Willem Hoogstraten
10/27/2023, 7:12 PMJan Willem Hoogstraten
10/27/2023, 7:12 PMJan Willem Hoogstraten
10/27/2023, 7:12 PM