Faceting in Algolia search engine index

Viewed 27

I'm working on integrating the Algolia search engine using nodeJS, having a bit of trouble getting proper facets for an array properties in Algolia For example: Having an items property in a record of the Algolia index which contains data in a given format:-

{
  id:1,
  category:'books',
  items:  [
      { id: 1, name: 'C Programming Language', instock: true },
      {
        id: 2,name: 'Head First C',instock: false,
      },
    ];
} 

We want to get only those items name in the facet for which the instock value is true. Applied distinct on items.name and filter by instock:true still getting 'C Programming Language' and 'Head First C' both names in facets.

Expected result: I should get only 'C Programming Language' in the items name facet if records are filtered by instock value true.

Is there some sort of option I'm missing? Any help would be appreciated.

0 Answers
Related