algolia/algoliasearch-client-node

Can add the support for Disjunctive Faceting?

Closed this issue · 2 comments

There is helper in js client

http://www.algolia.com/doc#DisjunctiveFaceting

can you make the support for the node client?

Do you think the following patch allows you to use https://github.com/algolia/algoliasearch-client-js/blob/master/src/algoliasearch.helper.js ?

index 60146c7..3dcf314 100644
--- a/src/algoliasearch.helper.js
+++ b/src/algoliasearch.helper.js
@@ -43,7 +43,7 @@
    * @param {string} index the index name to query
    * @param {hash} options an associative array defining the hitsPerPage, list of facets and list of disjunctive facets
    */
-  window.AlgoliaSearchHelper = function(client, index, options) {
+  var AlgoliaSearchHelper = function(client, index, options) {
     /// Default options
     var defaults = {
       facets: [],            // list of facets to compute
@@ -248,4 +248,10 @@
       return facetFilters;
     }
   };
+
+  if (window) {
+    window.AlgoliaSearchHelper = AlgoliaSearchHelper;
+  } else if (module && module.exports) {
+    module.exports = AlgoliaSearchHelper;
+  }
 })();

Oh wait, I forgot some details about the success/error flags and the multiQueries method.