Monday, 5 January 2015

Difference between Search Result and Content Search web part– part IV – Priority of the content

Hi Again,

Today, next difference in series between the Content Search web part and Search Result web part.

One more interesting difference, related to priority of the content. When we configure the Content Search web part we have one option “Priority” under “SETTINGS” tab as follows:

This option is available only for Content Search web part and not for Search Result web part. This means all the queries of Search Result web part has the “Regular” priority.
These options in web part are referred as “QueryBuilderMode” enum.

Background: Actually there is common application page “querybuilder.aspx” for both Content Search and Search Result web part and on this page these priority radio buttons are added under “Priority” div.

There is JS file “Search.Configuration.debug.js” which calls the method launchQueryBuilder to launch the “Query Builder” when “Change Query” button from respective tool part is clicked.

In this JS file there is check if launchQueryBuilder is called for Search Result web part then in code hiding the “Priority” div and that’s why this option is not coming for Search Result web part.

So this is the background but what actually means this setting.  This setting is useful when SharePoint is running under heavy load. In this case, queries runs as per their priorities in relation to other Content Search web parts available on the page. 
Scenario: Considering there are 3-4 Content Search web parts on page. Here, we can take decision like content of which Content Search web part is most important (primary content) as compare to content of other Content Search web part. So we can set the priority “High” for this web part.

Other case is most of the time we use the Tabbed web part and then we have Content Search web parts on multiple tabs. So here first tab becomes very important as compared to other tabs since initially other tab content is hidden from the user. So we can set the priority “High” for the web part which is on first tab and priority “Normal” or “Low” for the web parts on the rest of the tabs.

Enjoy reading :)

Feel free to comment / feedback if any or if you have any query :)


No comments: