> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/umbraco-cms/19.latest/develop-with-umbraco/search/searching-file-content.md).

# Searching file content

A guide for including file content in search.

File content is not indexed for search in Umbraco by default. There are two main reasons for that:

* It can be a CPU- and memory-intensive task, which could slow down your entire site.
* Umbraco can only support a limited number of file formats out of the box.

If you need to search file content, we have created a file-to-text indexing package. It is free, open source, and can be installed as an optional add-on.

{% hint style="warning" %}
Carefully test the CPU and memory impact of utilizing this package before deploying it to production.
{% endhint %}

## Installation instructions

Install the package from NuGet:

```
dotnet package add Umbraco.Cms.Search.Extension.FileToText
```

The package registers itself automatically at start-up.

## How it works

By default, the package attempts to index the file content of all Content and Media items.

File content is loaded from any property containing binary file data (for example, a File Upload editor). Subject to file format support, the package extracts text from the binary data and adds it as text to the search index.

Effectively, this means the file content of Content and Media items will be surfaced as results from free text search.

{% hint style="info" %}
For Content, this applies to both drafts and published versions.
{% endhint %}

## Configuration options

You can configure the package behavior by adjusting its `IndexingOptions` using the options pattern. It allows for:

* Disabling Content and Media indexing individually.
* Setting an upper limit to the size of files being processed for indexing.

{% code title="FileToTextConfigurationComposer.cs" %}

```csharp
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Search.Extension.FileToText.Configuration;

namespace My.Site.DependencyInjection;

public class FileToTextConfigurationComposer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
        => builder.Services.Configure<IndexingOptions>(config =>
        {
            // Set this to false to skip indexing of file content for Content items
            config.IncludeContent = false;

            // Set this to false to skip indexing of file content for Media items
            config.IncludeMedia = false;

            // Define this to skip files larger than a specified upper boundary
            config.MaxFileSize = 10 * 1024 * 1024; // 10 MB
        });
}
```

{% endcode %}

## File formats included

The package supports indexing of PDF, Markdown, and text files. You can extend this by [adding your own file formats](/umbraco-cms/19.latest/develop-with-umbraco/search/searching-file-content/adding-file-formats.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.umbraco.com/umbraco-cms/19.latest/develop-with-umbraco/search/searching-file-content.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
