# Facet Field Retrieval

Facet fields are retrieved from Elasticsearch before product results. The retrieval process:

1. **Facet Configuration**: If a Facet Configuration exists for an attribute, it determines the facet's aggregation settings, field mappings, and extraction strategy
2. **Size Limits**:
   * If attribute key is "category\_ids", size is set to 500
   * Otherwise, default size is 100
   * Custom sizes can be configured via Facet Configuration
3. **Inventory Strategy Context**: Facet fields are returned with inventory strategy context, as prices and availability may vary by inventory strategy
4. **Widget Creation**: After retrieval, facet data is converted to widgets:
   * Attribute IDs from Elasticsearch are used to fetch attribute values from the database
   * Widget types are determined by attribute configuration
   * Widgets include choices with quantities, labels, and selection states


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.akinon.com/commerce-openapis/search/introduction/facet-field-retrieval.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
