Is it possible to show different search results ( on the basis of templates) in different tabs (one tab for one template like article/blog/documents) in same page for same keywords using SXA search components?
Yes. All you have to do is to put two Search Results renderings on each tab and configure search scope.
Use search scope to define which templates should appear on the particular tab.
Search scope – select a scope to limit the search results.
I wrote a blog post about configuring search for blog purposes recently. This section describe how to create Search Scope and assign it.
If you've got a search filters on a page they will modify both Search Results results unless you define search signature
Search results signature – enter the unique signature of a specific Search
Results rendering to limit the search results. This can be convenient when you have more than one search result rendering on the page.
Yes, it is possible to achieve this with OOTB SXA settings.
- Open the Control Properties for
Search Boxrendering and edit the following fields:
Search results signature – enter the unique signature of a specific Search Results rendering to limit the search results. This will be convenient when you have more than one search result rendering on the page. In our case, we’ll be having two search results rendering on the search page. Just placed all the Search Results signatures in the Search results signature separated by ",".
- Search result configuration: Open the search page in the experience editor.
Tabrendering from the toolkit and create new tab data items so that we can use the first tab for the document (items based on document template) search and the second tab for site-wide search.
Set the Search Criteria for both search results:
- Now you can provide a Search scope for each tab to restrict the search results.
For more details refer to this blog - https://sitecorewithraman.wordpress.com/2021/08/10/sxa-multiple-search-results/