0

The facets property of SearchDocumentResult should return the facets involved in the query as well as their values, right? But it only returns undefined. If this is the expected behavior, is there another way to consult the facets through sdk?

Diego
  • 55
  • 1
  • 4

1 Answers1

0

This link provides you more information about the facets. As you can see in the article, facets are a collection(arrays in JS) of facetable values defined in the index.

For example, if you define an index 'Hotel', you can mark its properties 'HotelId' and 'Rating' as facetable. The results will be displayed accordingly. In the result, you will be able to read 'HotelId' and 'Rating'.

But, there will not be any seperate property by name 'facets' from which you can read the list of facets that you passed.

  • Let me explain better: In your example with Index Hotel. As I would do, using the SDK to return the facets of that index. I would like to return their names, such as HotelId and Rating and also all possible values ​​for these facets. It is possible? – Diego Mar 02 '21 at 18:46
  • No. Those are not part of the SearchDocumentResult Object. – Sarangan Rajamanickam Mar 02 '21 at 23:04