typesense / typesense-instantsearch-adapter

A JS adapter library to build rich search interfaces with Typesense and InstantSearch.js
MIT License
390 stars 64 forks source link

Reasons for not working queryRule #151

Open pixelkoduje opened 1 year ago

pixelkoduje commented 1 year ago

For what technical reasons are these features not working with the latest typesense? queryRuleCustomData queryRuleContext

jasonbosco commented 1 year ago

While Typesense server supports query rules (called overrides / curation in Typesense), we don't support returning custom data or context in overrides yet. So we would need to first add these features to Typesense server, before we can add support in the adapter.

Could you open separate issues for each in Typesense repo, along with your use-case for each of these? We can then prioritize based on demand.

pixelkoduje commented 1 year ago

I believe that if we do at least part of this element - and suggestions (out of the box), we can chase even algolia very quickly. I think that dynamic widgets were already a milestone. Because it's such a hot feature.

pixelkoduje commented 1 year ago

Hello @jasonbosco. https://www.algolia.com/doc/api-reference/widgets/query-rules/react-hooks/ It is the same as dynamicWidget. It just tracks and returns results - based on what's active. I don't think it matters, in the context of typesense. It would be nice if you did that with the new update. For larger projects, this is a useful feature - including my project I wrote about. image Also works, but returns no results.

pixelkoduje commented 1 year ago

From what I can see there is no problem to implement this. Even if we download e.g. "banners" from an external collection - we use multisearch after all. Let's do that and typesense will be fully ready replacement instead of algolia.

jasonbosco commented 1 year ago

In the case of dynamicWidgets, it requires facet data and this information is already returned by the Typesense Server API response and this adapter just transforms those facet counts to a format that dynamicWidgets understands.

But in the case of the query rules related widgets, the Typesense Server API does not return the data required to transform it to the instantsearch format, since Typesense Server API does not support these particular features (query rule context and query rule user data)...

If you're anyway using multi-search to download banners, one thing you could do is, use transformItems in the hits or infiniteHits widgets to access particular items in the search results?