typesense-instantsearch-adapter 2.9.0-4 → 2.9.0-5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -655,9 +655,7 @@ If a particular version of the above libraries don't work with the adapter, plea
655
655
 
656
656
  ### Widget Compatibility
657
657
 
658
- This adapter works with all widgets in [this list](https://www.algolia.com/doc/api-reference/widgets/js/), _except_ for the following:
659
-
660
- - `queryRuleContext`
658
+ This adapter works with all widgets in [this list](https://www.algolia.com/doc/api-reference/widgets/js/)
661
659
 
662
660
  ## Development
663
661
 
@@ -590,6 +590,11 @@ var SearchRequestAdapter = /*#__PURE__*/function () {
590
590
  }
591
591
  }).join(",");
592
592
  }
593
+ }, {
594
+ key: "_adaptRulesContextsToOverrideTags",
595
+ value: function _adaptRulesContextsToOverrideTags(ruleContexts) {
596
+ return ruleContexts.join(",");
597
+ }
593
598
  }, {
594
599
  key: "_buildSearchParameters",
595
600
  value: function _buildSearchParameters(instantsearchRequest) {
@@ -634,6 +639,9 @@ var SearchRequestAdapter = /*#__PURE__*/function () {
634
639
  typesenseSearchParams.facet_query = "".concat(params.facetName, ":").concat(params.facetQuery);
635
640
  typesenseSearchParams.per_page = 0;
636
641
  }
642
+ if (params.ruleContexts && params.ruleContexts.length > 0) {
643
+ typesenseSearchParams.override_tags = this._adaptRulesContextsToOverrideTags(params.ruleContexts);
644
+ }
637
645
 
638
646
  // If a custom vector query is specified, set q=*
639
647
  if (params.typesenseVectorQuery) {