Blog Post

AI - Azure AI services Blog
3 MIN READ

New enhanced navigation in Azure AI Search

MattGotteiner's avatar
MattGotteiner
Icon for Microsoft rankMicrosoft
Apr 10, 2025

Faceted navigation is a key component of search experiences, helping users intuitively drill down through large sets of search results by refining their queries quickly and efficiently.

 We are announcing several improvements to facets in preview:

  • Hierarchical facets enable developers to create multi-level navigation trees, offering a more organized view of search categories
  • Facet filtering provides precision by allowing regular expressions to refine the facet values displayed
  • Facet summing introduces the ability to aggregate numeric data within facet

Hierarchical Facets

Facets in Azure AI Search were previously limited to a flat, one layer model. Consider the following index which models a product catalog:

Product ID

Name

Category

Subcategory

Price

P001

UltraHD Smart TV

Electronics

Televisions

$799.99

P002

Gaming Laptop Pro

Electronics

Computers

$1299.95

P003

Espresso Coffee Maker

Home Appliances

Kitchen

$199.50

P004

Robot Vacuum Cleaner

Home Appliances

Cleaning

$399.99

 

Using the regular facet syntax, we can only list distinct categories and subcategories. We cannot express the parent relationship between a subcategory and its category. Using the hierarchical faceting operator >, we can solve this problem and reveal the distinct pairs of categories and subcategories. The following example API request illustrates how to use hierarchical faceting in your application:

POST https://[service-name].search.windows.net/indexes/product-catalog/docs/search?api-version=2025-03-01-Preview
{
  "facets": [ "Category > Subcategory" ]
}

The output contains each subcategory underneath its parent category:

{
"@search.facets": {
    "Category": [
      {
        "value": "Electronics",
        "count": 2,
        "@search.facets": {
          "Subcategory": [
            {
              "value": "Computers",
              "count": 1
            },
            {
              "value": "Televisions",
              "count": 1
            }
          ]
        }
      },
      {
        "value": "Home Appliances",
        "count": 2,
        "@search.facets": {
          "Subcategory": [
            {
              "value": "Cleaning",
              "count": 1
            },
            {
              "value": "Kitchen",
              "count": 1
            }
          ]
        }
      }
    ]
}

Facet Filtering

Part of the faceting process is finding all facet values present in the results for a search query. Facet filtering allows further refinement of these facets using a regular expression. Facets can either be included using the includeTermFilter operator or excluded using excludeTermFilter operator. The following example API request illustrates how to use facet filtering in your application:

POST https://[service-name].search.windows.net/indexes/product-catalog/docs/search?api-version=2025-03-01-Preview
{
   "facets": [ "(Category, includeTermFilter: /Electronics/) > (Subcategory, excludeTermFilter: /Televisions/)" ]
}

In this example, any category that isn’t “Electronics” is filtered out and all subcategories except “Televisions” are filtered out:

{
  "@search.facets": {
    "Category": [
      {
        "value": "Electronics",
        "count": 2,
        "@search.facets": {
          "Subcategory": [
            {
              "value": "Computers",
              "count": 1
            }
          ]
        }
      }
    ]
  }
}

Facet Summing

Azure AI Search was previously unable to answer any analytical questions about facets. In our example index, we could not write a search query to answer the question “What’s the total price of every product by category?”. Instead, we had to run a search query to fetch every price for every product and sum it in our search application. Facet summing allows you to sum facet values in a single search query without fetching all search results using the metric operator. The following example API request illustrates how to use facet summing in your application:

POST https://[service-name].search.windows.net/indexes/product-catalog/docs/search?api-version=2025-03-01-Preview
{
  "facets": [ "Category > (Price, metric: sum)" ]
}

In the output, you can see the total price for all products by category:

{
  "@search.facets": {
    "Category": [
      {
        "value": "Electronics",
        "count": 2,
        "@search.facets": {
          "Price": [
            {
              "sum": 2099.94
            }
          ]
        }
      },
      {
        "value": "Home Appliances",
        "count": 2,
        "@search.facets": {
          "Price": [
            {
              "sum": 599.49
            }
          ]
        }
      }
    ]
  }
}

Next Steps

Hierarchical facets, facet filtering, and facet summing enhance the way users interact with and drill down into complex datasets. Hierarchical facets add support for multi-level navigation across relationships in datasets, facet filtering allows for precise control over which facet values are displayed, and facet summing aggregates numerical metrics in a single search query. Using these features can elevate your search navigational experience.

Updated Apr 10, 2025
Version 1.0
No CommentsBe the first to comment