Typesense Search/Filter/Query Context with InstantSearch Adapter
TLDR Jainil wanted to access typesense parameters for bulk operations. Jason suggested accessing the 'uiState' of the widgets and proposed making _buildSearchParameters
a public method. They also discussed the differences between uiState
and instantsearchRequest.params
in context of typesense parameters.
Aug 18, 2023 (3 months ago)
Jainil
03:22 PMJason
04:49 PMJason
04:49 PMAnd send that state to the backend?
Aug 23, 2023 (3 months ago)
Jainil
08:05 PMIs there any way that some of the helper functions in https://github.com/typesense/typesense-instantsearch-adapter/blob/master/src/SearchRequestAdapter.js#L361 can be exposed as part of the searchadapter API? Would love to not have to rewrite these for the filters, and be more robust to potential changes
Jason
08:56 PM_buildSearchParameters
to a public method, so you can use it by instantiating SearchRequestAdapter
. Do you want to do a PR that renames that method to transformSearchParameters
?Jainil
08:56 PMJainil
11:11 PMThe uiState provides the following data -> the index keying a dict with the different refinementLists/menus/configure "filter"/ranges.
{"profiles":{"range":{"mixed_profile.years_of_experience":"3:4"},"refinementList":{"mixed_profile.skills":["C++"]},"menu":{"segments.id":"kpu9rfNB"},"configure":{"filters":"(mixed_profile.location: NY)"}}}
It seems as though
_buildSearchParameters
(or transformSearchParameters
) uses the instantsearchRequest.params
to transform "algolia params" into "typesense params", so basically the parsing of the uiState into these params is already built into instantsearch.Wouldn't it be better for the instantsearchadapter to use the uiState directly instead of using algolias params to convert into the typesense params? Detaching from the double-conversion could allow for the implementation of features like multiple geo filters (which algolia only limits to one field).
For my use case, exposing of the
transformSearchParameters
into a public method would be very useful, but I'd still have to dig around instantsearch to find where uiState is converted into the algolia params (or also possibly build that myself, which isnt a huge deal considering low # of filter types)Jainil
11:12 PMAug 24, 2023 (3 months ago)
Jason
12:13 AMinstantsearchRequest.params
…> Wouldn’t it be better for the instantsearchadapter to use the uiState directly instead of using algolias params to convert into the typesense params?
If it’s available sure, but I don’t think the uiState data structure is available within the searchClient context… Instead Algolia only sends the resolved search params.
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Troubleshooting Typesense Setup and Understanding Facets and Keywords
Demitri encountered errors when exploring Typesense for the first time. Jason guided them through troubleshooting and discussed facets, keyword settings, and widget configurations. Helin shared a Python demo app and its source code to help Demitri with their project.
Refine Method Issue in Typesense Instant-Search Adapter
Ankit has trouble using the refine method for geopoint fields in the typesense instant-search adapter. Jason identified the issue in the CURL request and proposed alternatives while prepping to address the issue in the adapter.
Implementing State Export Feature Using Typesense InstantSearch.js on Node.js Backend
Kyle needed help passing search state to backend for implementing an "Export" feature, while using Typesense InstantSearch. Jason provided multiple solutions including advice on using Typesense InstantSearch adapter. The issue was resolved after some iteration.
Typesense Capabilities and Troubleshooting Queries
A had issues with refinement lists and analytics in Typesense. Jason provided a possible solution and recommended the analytics widget. They clarified import size limits and helped identify a filter issue in A's query. Upgrade options are in Typesense's roadmap.
Fixing Multiple Document Retrieval in Typesense
Phil needed an efficient way to retrieve multiple documents by id. Kishore Nallan proposed a solution available in a pre-release build. After some bug fixing regarding id matching by Jason and Kishore Nallan, Phil successfully tested the solution.