> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Algolia Query Categorization for Magento

> Set up Query Categorization with the Magento extension.

export const Records = () => <Tooltip tip="A record is a searchable object in an Algolia index. Each record consists of named attributes." cta="Algolia records" href="/doc/guides/sending-and-managing-data/prepare-your-data#algolia-records">
    records
  </Tooltip>;

export const Index = () => <Tooltip tip="An Algolia index is a searchable dataset that consists of records and configuration settings. These settings define how the records are searched and ranked.">
    index
  </Tooltip>;

[Query Categorization](/doc/guides/algolia-ai/query-categorization)
is a powerful Algolia feature that can be used out of the box with the Magento extension.

You can natively use the `categories` attribute from the product <Records />.

```jsonc JSON icon=braces theme={"system"}
[
  // ...
  "categories" :{
    level0: [ "Men" ],
    level1: [ "Men /// Tops" ],
    level2: [ "Men /// Tops /// Hoodies & Sweatshirts" ]
  }
  // ...
]
```

Configure the Query Categorization's settings with this attribute selecting its hierarchical levels in the **Query Categorization > Categories settings** section of the <Index /> configuration within the Algolia dashboard:

<img src="https://mintcdn.com/algolia/6YAuCqOjAR64l9hZ/doc/integration/magento-2/how-it-works/query-categorization-config.jpg?fit=max&auto=format&n=6YAuCqOjAR64l9hZ&q=85&s=a9adf83298c41a8793c0adfb2d628ec1" alt="Screenshot of index classification settings with 'categories.level0', 'level1', and 'level2' selected, and an example hierarchy." width="2652" height="992" data-path="doc/integration/magento-2/how-it-works/query-categorization-config.jpg" />

For more information about enabling and configuring this feature,
see [Query Categorization](/doc/guides/algolia-ai/query-categorization#set-up-query-categorization).
