#azure ai index schema - facets

1 messages · Page 1 of 1 (latest)

mellow linden
#

How do I query this schema for facets without calling the index api for each facet name to retrieve the associated values?
Similar to here:
https://learn.microsoft.com/en-us/azure/search/search-faceted-navigation#facets-syntax
Use a POST and under "facets", use an array of the different facets you want to return the values for.
https://learn.microsoft.com/en-us/rest/api/searchservice/search-documents#query-parameters

One thing to consider is caching some of this client side for improved performance.

Query an Azure AI Search index and return search results.

Add faceted navigation for self-directed filtering in applications that integrate with Azure AI Search.

frigid ravine
#

Thanks for the reply

When I do use the facets: [‘facet/name’, ‘facet/values’] in my post it returns them, but there not correlated to each other or linked in any way. Since facet name is part of the same complextype as facet values, I’d imagine they’d be linked some how but it just returns a list of facet name and facet value. So how do I build a hierarchy faceted navigation bar?

Eg

Facet/name: [
{
Count: 283,
Value: “Pencil”
},
{

Count: 73,
Value: “Paper”
},
…..
],
Facet/values: [
{
Count: 23,
Value: “#2”
},

{
Count: 26,
Value: “#3”
},
….
]

No way to know which category (pencil) is the header for which subcategory (#2)