# Result interceptors

## Feature

Intercept results of SOLR before parse in POCO

## How to

1. Create a class that implements **IResultInterceptor**

```csharp
    public class MyInterceptor : IResultInterceptor
    {
        public void Execute(string requestHandler, ref string json) // method from interface
        {
            // some code
        }
    }
```

1. Add instance using method **Add** in **DocumentCollection<>**

```csharp
    var myInterceptor = new MyInterceptor();

    DocumentSearch<TechProduct> documentSearch; // From your DI provider
    documentSearch
        .Add(myInterceptor)
        // ...  Other settings
        .Execute();
```


---

# 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.4.0/tutorials/advanced-features/result-interceptors.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.
