algolia / algoliasearch-helper-js

Helper for implementing advanced search features with Algolia
https://instantsearchjs.netlify.app/algoliasearch-helper-js/
MIT License
174 stars 46 forks source link

Use of wildcard in facets not working #607

Closed mapolonio closed 5 years ago

mapolonio commented 6 years ago

Hi, I'm trying to retrieve all the facets of the result set by querying with

{
  facets: ['*'],
  ...
}

I'm getting a result with an empty array in the facets key. Is the use of wildcard supported?

According to this: https://www.algolia.com/doc/guides/searching/faceting/?language=javascript#retrieving-facets it should work.

Example: https://codepen.io/mapolonio/pen/OZoyKM

bobylito commented 6 years ago

Hi @mapolonio, indeed it's not supported because the helper builds on top of the facets to let you do disjunctive and hierarchical facets. You will have to enumerate all your facets by hand.

Can you help me understand what is your use-case? Especially I am curious why do you go for the Helper instead of the InstantSearch family of libraries (react-instantsearch, instantsearch.js, angular-instantsearch or vue-instantsearch)

bobylito commented 6 years ago

@mapolonio We'd be happy to hear more from you :)

mapolonio commented 6 years ago

Weel, I'm sorry to hear it is not supported. Do you have any advice for my case? The problem is this: I have an index with houndreds of thousands of items, each of them has a retailFacets attribute that contains nested attributes, like

item: {
   ...some attributes,
   retailFacets: {
     color: red,
     size: 35cm,
     weight: 1k,
     ....
  }
}

inside retailFacets can be anything, as the items belong to diverse categories. You could find computer related facets and also clothing related facets, and many more. So, as the user selects certain categories on the GUI, we would like to present the concerning retailFacets without having to declare them one by one in the search configuration.

The reason we are using the Helper is because it was an already included dependency in the project, and for this precise matter we are discussing if we need to change to another library.

Haroenv commented 5 years ago

just noticed this is a duplicate of algolia/instantsearch#5723