I am using the below mentioned code to move the Layered navigation above content on Search pages in catalogsearch_result_index.xml
<body>
<move element="catalogsearch.leftnav" destination="content" before="-" />
</body>
But it is not showing above content on search pages.
Please help me in correcting the code, if i am missing something in this
Best Answer
You need to use
<move element="sidebar.main" destination="content" before="-"/>
The layered navigation for the search results page is defined in/vendor/magento/module-layered-navigation/view/frontend/layout/catalogsearch_result_index.xml
and the referenceContainer issidebar.main
notcatalogsearch.leftnav
.