---
title: "File Indexer"
version: "1.6"
source: "FileIndexer.md"
rendered: "2026-09-22T06:15:12+00:00"
---

# File Indexer {#file-indexer}

The File Indexer is a powerful component of the TYPO3 Search Algolia extension that indexes files stored in TYPO3's File Abstraction Layer (FAL). It extracts metadata and content from files, making them searchable through Algolia. This is particularly useful for websites with document repositories, downloadable resources, or media libraries.

## How It Works {#how-it-works}

The File Indexer processes files based on the configuration in your indexing service. When triggered, it:

1.  Retrieves files from the file collections specified in your configuration
1.  Filters files based on their properties (file extension, no_search flag, etc.)
1.  Extracts metadata from each file
1.  For supported file types (currently PDF), extracts the actual content
1.  Sends the processed data to Algolia for indexing

This allows users to search not only for file names and metadata but also for text contained within supported documents.

## File Properties {#file-properties}

The "sys_file_metadata" table has been expanded to include the "no_search" field, which behaves identically to the existing field in the "pages" table and, if set, allows a file to be excluded from indexing. By default, this field is not set for all files, meaning they will be indexed.

To set the property, click on the desired file in the file list and switch to the new "Behavior" tab. Here you can adjust the value for the "no_search" property accordingly.

![metadata-no-search](Images/FileIndexer-001.png)

*Fig. 1: Exclude file from indexing*

## Indexed Fields {#indexed-fields}

### Standard Fields {#standard-fields}

In addition to the standard fields, the following fields are indexed by default for files:

| Field | Description |
| --- | --- |
| extension | The file extension. |
| mimeType | The MIME type of the file. |
| name | The name of the file. |
| size | The size of the file in bytes. |
| url | The relative URL to the file (only included if available). |
| content | The content of the file (only included for supported file types, currently only PDF). |

### Custom Fields {#custom-fields}

Additional fields to be indexed from the file metadata can be defined using the TypoScript configuration module.tx_typo3searchalgolia.indexer.sys_file_metadata.fields. This is set by default as follows:

```typo3_typoscript
module {
    tx_typo3searchalgolia {
        indexer {
            sys_file_metadata {
                fields {
                    title = title
                    description = description
                    alternative = alternative
                    creator = author
                }

                # Comma-separated list of allowed file extensions
                extensions = pdf
            }
        }
    }
}

```

## Context menu {#context-menu}

A single file can also be directly enqueued using the TYPO3 context menu in the file list:

![file-context-menu](Images/FileIndexer-002.png)

*Fig. 2: Directly enqueue a file*

## Usage and Best Practices {#usage-and-best-practices}

### Supported File Types {#supported-file-types}

Currently, the File Indexer fully supports:

-   PDF files (including content extraction)
-   Other file types (metadata only)

The supported file extensions can be configured in the TypoScript settings as shown in the Custom Fields section.

### Triggering File Indexing {#triggering-file-indexing}

Files are indexed when:

-   The indexing is triggered through the backend module
-   A file is directly enqueued via the context menu
-   A scheduled task runs the indexing process

### Best Practices {#best-practices}

1.  **File Collections**: Organize your files into logical file collections to make indexing management easier. This allows you to selectively index different types of files for different purposes.
1.  **Metadata Quality**: Ensure your files have proper metadata (title, description, etc.) as this significantly improves search quality. Well-described files are more likely to appear in relevant search results.
1.  **File Size Considerations**: Be mindful of very large PDF files, as content extraction can be resource-intensive. Extracted content is automatically truncated to stay within the search engine's per-record size limit for most files. If a record is still too large after truncation (e.g. because of other oversized fields), it is removed from the index queue without being indexed.

    The truncation limit defaults to a conservative 8000 bytes, safe for Algolia's free tier. If your plan allows larger records, you can raise it by overriding the `$maxContentBytes` constructor argument of `UpdateAssembledFileDocumentEventListener` in your own `Services.yaml`:

    ```yaml
    services:
      MeineKrankenkasse\Typo3SearchAlgolia\EventListener\UpdateAssembledFileDocumentEventListener:
        arguments:
          $maxContentBytes: 50000
        tags:
          - name: event.listener
            identifier: 'typo3-search-algolia/update-assembled-file-document-event-listener'
            event: MeineKrankenkasse\Typo3SearchAlgolia\Event\AfterDocumentAssembledEvent

    ```

    The `tags` block must be repeated exactly as shown, redeclaring a service replaces its whole definition rather than merging with it, so omitting the event listener tag silently drops the listener from the container instead of raising an error. Check your actual Algolia plan's record size limit before choosing a value, and leave headroom for the record's other fields (name, url, title, description, ...), not just the content field itself.
1.  **File Extensions**: Only enable content extraction for file types that contain searchable text. Adding non-text file types to the extensions list won't provide useful search content.
1.  **Security Awareness**: Remember that indexed file content becomes searchable. Ensure that sensitive documents are either excluded from indexing or properly access-restricted in your search implementation.
