I would like to set as the default order in the search results page "relevance" in descending order.

How can i do?


1 Answer 1


Create a file named catalogsearch_result_index.xml at Venodr\Module\view\frontend\layout and paste the following code

 <?xml version="1.0"?>
 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <referenceContainer name="content">
        <referenceBlock class="Magento\CatalogSearch\Block\SearchResult\ListProduct" name="search_result_list">
            <action method="setDefaultDirection">
                <argument name="dir" xsi:type="string">

Now setDefaultDirection accordingly

Your Answer

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

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