---
title: "Feature: #93494 - New PSR-14 ModifyQueryForLiveSearchEvent"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-93494"
source: "Changelog/12.0/Feature-93494-NewPSR-14ModifyQueryForLiveSearchEvent.rst"
typo3-version: "12.0"
typo3-major: 12
type: "feature"
issue: 93494
forge: "https://forge.typo3.org/issues/93494"
tags: ["Backend", "PHP-API", "ext:backend"]
rendered: "2026-09-25T23:17:45+00:00"
---

# Feature: #93494 - New PSR-14 ModifyQueryForLiveSearchEvent {#feature-93494}

See [forge#93494](https://forge.typo3.org/issues/93494)

## Description {#description}

A new PSR-14 event `\TYPO3\CMS\Backend\Search\Event\ModifyQueryForLiveSearchEvent`
has been added to TYPO3 Core. This event is fired in the
`\TYPO3\CMS\Backend\Search\LiveSearch\LiveSearch` class
and allows extensions to modify the `QueryBuilder` instance
before execution.

The event features the following methods:

-   `getQueryBuilder()`: Returns the current `QueryBuilder` instance
-   `getTableName()`: Returns the table, for which the query will be executed

Registration of the event in your extension's `Services.yaml`:

```yaml
MyVendor\MyPackage\EventListener\ModifyQueryForLiveSearchEventListener:
  tags:
    - name: event.listener
      identifier: 'my-package/modify-query-for-live-search-event-listener'
```

The corresponding event listener class:

```php
use TYPO3\CMS\Backend\Search\Event\ModifyQueryForLiveSearchEvent;

final class ModifyQueryForLiveSearchEventListener
{
    public function __invoke(ModifyQueryForLiveSearchEvent $event): void
    {
        // Get the current instance
        $queryBuilder = $event->getQueryBuilder();

        // Change limit depending on the table
        if ($event->getTableName() === 'pages') {
            $queryBuilder->setMaxResults(2);
        }

        // Reset the orderBy part
        $queryBuilder->resetQueryPart('orderBy');
    }
}
```

## Impact {#impact}

It is now possible to use a new PSR-14 event for modifying the live
search query. This can be used, for example, to adjust the limit for a specific
table or to change the result order.
