Distinct smart search results in same page

Viola Feinai asked on December 4, 2019 11:15

I need to implement search functionality to different groups of results in the same page. Currently I have three search dialogs that are related to three search results (each search dialog is connected to exactly one search result web part through its web part id), however when I type something in one of the search dialogs all search results are affected instead of the one that is related.

Thank you in advance

Recent Answers


Peter Mogilnitski answered on December 4, 2019 13:58

If i am not mistaken search parameters (searchtext and searchmode) are passed by query string . Th e search results web part is looking for them. If you have 3 of thenm one page - they all going to be executed.

You have a user interface issue. 3 search boxes on one pages is a bit confusing. You need have one search box and drop where a user can pick search group (i.e. search index(s)). Essentially you need to form a query string like this ?searchtext=test&searchmode=anyword&searchindexname=CorporateSite.Default

And inside search result web part you put macro in search index text box: {%searchindexname%}.

So basically the only thing you need do is to add a drop down that will add/update selected index in the query string

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.