#community-help

Discussing `additionalSearchParameters` and `group_by` in TypesenseInstantSearchAdapter

TLDR ilia requested advice on manipulating group_by during runtime. Jason suggested a workaround, but the limitations of Algolia was a problem, resulting in ilia choosing to use the pure Typesense API instead.

Powered by Struct AI

1

4
5mo
Solved
Join the chat
Jul 10, 2023 (5 months ago)
ilia
Photo of md5-c06627e5ffc62c0358b053cdc09b2ad0
ilia
01:30 PM
Hey! Quick question about additionalSearchParameters and group_by specifically. Is it the only option setting group_by during TypesenseInstantSearchAdapter initialisation?
Currently it's a bit messy process to update group_by conditionally ( need to updateConfig ). Would be nice to have simpler API to update the value during runtime ( similar to filtering / sorting ). Am I missing anything?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:56 PM
Could you try setting the following via the configure widget:

distinct: 2
attributeForDistinct: '<fieldToGroupBy>'
03:57
Jason
03:57 PM
If that doesnโ€™t work, then unfortunately itโ€™s a limitation of instantsearch / Algolia since Algolia might not allow runtime configuration of the attributeForDistinct unlike in Typesense
ilia
Photo of md5-c06627e5ffc62c0358b053cdc09b2ad0
ilia
08:13 PM
Thank you! We've came to conclusion to throw away insta-search and just use pure Typesense API ๐Ÿ˜… ( since we are using custom UI anyway )

1