# Nested facet

## Feature

Create a nested facet

## How to

1. Configure facet (field, range, query or spatial)

```csharp
    DocumentCollection<TechProductDocument> documentCollection; // from DI

    var rersult = documentCollection
        .Select()
        .FacetField(q => q.InStock)
        .Execute();
```

1. Configure nested facet (field, range, query or spatial)

```csharp
    DocumentCollection<TechProductDocument> documentCollection; // from DI

    var rersult = documentCollection
        .Select()
        .FacetField(q => q.InStock, facet => facet
            .FacetField(q => q.Categories))
        .Execute()
        .Facets(out var data);
```

1. Follow instructions to read data of a facet [field](http://solr-express.readthedocs.io/en/stable/tutorials/facets/field), [range](http://solr-express.readthedocs.io/en/stable/tutorials/facets/range), [query](http://solr-express.readthedocs.io/en/stable/tutorials/facets/query) or [spatial](http://solr-express.readthedocs.io/en/stable/tutorials/facets/spatial)


---

# 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://solr-express.gitbook.io/docs/5.0.0/tutorials/facets/nested.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.
