# Overwriting the default search SQL-Query

**URL:** <https://forum.shopware.com/t/overwriting-the-default-search-sql-query/96666>\
**Category:** International (English Only)\
**Tags:** general, administration, programming, other\
**Created:** [13. Oktober 2022 um 10:11 UTC](https://forum.shopware.com/t/overwriting-the-default-search-sql-query/96666 "2022-10-13T10:11:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hulle24](https://avatars.discourse-cdn.com/v4/letter/h/e8c25b/32.png) [@hulle24](https://forum.shopware.com/u/hulle24)\
**Post date:** [13. Oktober 2022 um 10:11 UTC](https://forum.shopware.com/t/overwriting-the-default-search-sql-query/96666/1 "2022-10-13T10:11:11Z")

</div>

Hello,

I am currently developing a plugin for overwriting the existing Shopware Search functionality but could not find any documentation about my needs.

**What I exactly want to do?**

- I want to overwrite/re-write the SQL Query for the regular search page in the Shopware with my custom Plugin.
- I want to overwrite/re-write the Search Listing page.

**What is my goal?**

- When a search term comes to the Search controller I want to get this term and then perform my own SQL Query with this term using Symfony DBAL with my own parameters and own `order by`, `where` caluses.

**What I have already done?**

- I have created a Shopware 5 Plugin and installed it on dev branch. I have created a controller named Search in order to overwrite the existing official Shopware Search controller but it wasn’t possible for me to control/edit the SQL Query from that controller because as I see the whole Search Interface/Controller etc. goes far more deep into the Symfony and core Shopware classes.
