1

I'm trying to use 1 search box with 3 search results on the same page,this search box will trigger the 3 search results, each search result with a different scope, but the search results doesn't work correctly when there are more than one present. I'm using sitecore 9.3

Use Case:

A Search Box, a Tab component with three tabs, each tab with the Search Results component where each Search Results will display diferent results based on the selected scope.

enter image description here

Is there a way to this out of the box ?

2 Answers 2

1

I don't think this can work out of the box. The search results component reacts on a signature. In order to match the results with the search box those signatures need to be empty or the same.

The requests to the search API will work fine. But when the javascript gets the returned data, it will try to find the results component with your signature and it will find multiple. And it will use all... so the results that come last win and you will see the same results in all components.

In order to fix this, you could adjust the javascript (don't ask me how as I don't know).

Or go for an other solution, maybe use one search component and use the build-in facets. Those work fine and might give you a similar result: combine the scopes for the results and create facets to split them. I don't think you can set a facet directly though...

1

After some investigation through the javascript i found out that it is possible to have more than one Search Results in a page.

Just placed all the Search Results signatures in the Search Box signature separated by "," and it works.

enter image description here

enter image description here

This way each Search Result will render independently with just the Search Box in common and without any issues.

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.