Issue: Unable to segregate the results for the two search core results web part.

Need for Search core results web part

Firstly, I would like to specify the need of Search core results web part in SharePoint is to display Search results and give us control to update the look and feel for the same.

Generally, the results filtered in the search core results are based on keyword query specified with the query string parameter viz. ‘k’.

In cases where you need the query to be fixed, there is an option to specify ‘Fixed Keyword Query’:

Fixed Keyword Query

This was all about configuring on search core results with some query.

What do we do when we need another core results web part on the same page but configured with a different search query?

We would proceed and add another search core results web part on the page and configure it with a Fixed Keyword Query.

Referring to http://technet.microsoft.com/en-us/library/gg549987.aspx, I was able to resolve an issue wherein I was unable to segregate the results for the two search core results web part.

The point to note here is that ‘Search Core results’ has a property called “Cross Web Part Query ID” on the basis of which the search results are rendered. Whenever multiple search web parts are configured and we want them to display different query results, then we should make sure to change the “Cross Web Part Query ID” for each web part.

Cross Web part Query ID

The above property is in form of a drop down and should be different for each search core results web part if we expect different results.

If the ID is the same for multiple web parts, the search core results displays results in both the web parts on the basis of either of the query.

For e.g. Search for keyword ‘test’ in one web part and for ‘nest’ in other web part. The results returned on both the web parts would be on the basis of either ‘test’ or ‘nest’ depending on the preference which I am unaware of.

You guys are open to comment the preference taken by search core results in SharePoint. 🙂

Advertisements