Why does my search engine not navigate or call my custom controller when i have overriden my default Magento search engine.

When i search for a product keyword, it redirects to core


But i want it as:


I have overridden Catalogsearch in etc di as:

 <preference for="Magento\CatalogSearch\Controller\Result\Index" type="Company\Module\Controller\Result\Index" />

My frontend routes:

<?xml version="1.0"?>
  <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
    <route id="tglssearch" frontName="tglssearch">
        <module name="Vendor_Module"/>

1 Answer 1


Sachin S,

preference tag<preference></preference> rewrite a class. It does not override frontname of a module.

So you need to change




Also does not need route.xml as you have using same route

  • I have not manually added "tglssearch/result/?q=keyword" but what i want is when i search for a key, the url should redirect to my custom front name 'tgllsearch/result', instead of the core catalogsearch/result...is that not possible...???
    – Sushivam
    Jul 12, 2016 at 7:58
  • I really need this fix... @Amit i m finding ways to fix this from more than a week... after overriding my custom controller and phtml template, when i search for a keyword, my page goes blank... could you please check and help on this link magento.stackexchange.com/questions/122625/…
    – Sushivam
    Jul 12, 2016 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.