Configure properties of the Search Results Web Part in SharePoint Server 2013

Summary: Learn how to configure the query and properties of the Search Results Web Part, and how to disable stemming in the Web Part.

The Search Results Web Part displays the search results of a query entered in a Search Box Web Part. By default, the Search Results Web Part is used on all search vertical pages (results.aspx, peopleresults.aspx, conversationresults.aspx, videoresults.aspx). The Search Results Web Part displays the actual search results and it also passes the search results to the Refinement Web Part and the Search Navigation Web Part on the same page.

The Search Results Web Part uses a query that is specified in the Web Part to display search results. By default, the query defined in this Web Part uses the query variable {searchboxquery}. The query variable is a placeholder for a value. When a query is run, the placeholder is replaced with a value. For example, when a user types the search phrase yellow in the Search Box Web Part, the {searchboxquery} variable in the Search Results Web Part will resolve to search all items that contain the phrase yellow.

By changing the properties and query in the Search Results Web Part you can you can do the following:

Limit search results to a result source.

Add query variables or property filters that customize search results for different users.

Because SharePoint 2013 runs as websites in Internet Information Services (IIS), administrators and users depend on the accessibility features that browsers provide. SharePoint 2013 supports the accessibility features of supported browsers. For more information, see the following resources:

You can select pre-defined query variables from the drop-down list, and then add them to the query by clicking Add keyword filter.

Property filter

You can use property filters to query the content of managed properties that are set to queryable in the search schema.

You can select managed properties from the Property filter drop-down list. Click Add property filter to add the filter to the query.

Query text

By default, the query variable {searchboxquery} is defined for this field. You can change the query text by using KQL. For more information about KQL, see Keyword Query Language (KQL) syntax reference. Alternatively you can use the Keyword filter and Property filter lists to build the query.

The keyword query can consist of free-text keywords, property filters, or operators. Use braces to enclose query variables. The query variables will be replaced with an actual value when the query is run.

Keyword queries have a maximum length of 2,048 characters.

To define your query by using pre-defined variables, click Switch to Quick Mode. Select options as described in the following table:

Quick Mode

Select a query

Select a result source to specify which content should be searched. If you have shared a document library or list as catalog, the catalog result source will be displayed in this drop-down list.

Restrict by app

Select an option from the list to restrict results to a specific site, library, list, or URL.

Restrict by tag

You can limit results to content that is tagged with a term from a term set.

Select one of the following options:

Don’t restrict by any tag

Search results will not be limited based on tags (default).

Restrict by navigation term of current page

Search results will be limited to content that is tagged with the term of the current page. The current tag is displayed as the last part of the friendly URL. This option is only meaningful for sites that use managed navigation.

Restrict by current and child navigation

Search results will be limited to content that is tagged with the term of the current page (displayed as the last part of the friendly URL), and content that is tagged with sub-terms of the current page. This option is only meaningful for sites that use managed navigation.

Restrict on this tag

Search results will be limited to content that is tagged with the tag that you type inside the box.

Note:

When you switch to from Quick Mode to Advanced Mode, the result source that you selected from Select a query is replaced by a different result source. This result source could affect the search results. Therefore, make sure that you check the search results that are displayed in the SEARCH RESULT PREVIEW section, and add query configuration in the Query text field if you need to.

The REFINERS tab lists the managed properties that are enabled as refiners in the search schema. You can specify that the search results returned in the Search Results Web Part should be limited to one or more values from the refiners. Select a refiner in the list, and then click Add to add it to the query.

Click Show more if you want to define grouping of results. Under Group results, you can specify that the results should be grouped based on one or more managed properties. This is useful when you are displaying several variants for a given item, and want to group them under a single result.

On the SORTING tab, you can specify how search results should be sorted. This tab is available only if you use Advanced Mode. If you use Quick Mode, you can define sorting options in the result source.

In the Sort by drop-down list:

Select a managed property from the list of managed properties that are set as sortable in the search schema, and then select Descending or Ascending. To add more sorting levels, click Add sort level.

Note:

Sorting of search results is case sensitive.

Important:

If your result source contains sorting, you should not specify sorting in the Search Results Web Part. This is because the sorting in the result source overrides the sorting that you specify in the Search Results Web Part.

Select Rank to sort by relevance rank. You can then specify which ranking model to use or specify dynamic ordering rules.

(Optional) Select which ranking model to use for sorting in the Ranking Model list.

Under Dynamic ordering, you can specify additional ranking by adding rules that will change the order of results when certain conditions apply. Click Add dynamic ordering rule, and then specify conditional rules.

On the SETTINGS tab, specify the settings that are listed in the following table.

Query Rules

Select whether to use Query Rules or not.

URL Rewriting

Select if the URL rewrite to the item details page should continue to be relative for each catalog item as defined when you set up the catalog connection. This option is only meaningful for sites that use managed navigation and have connected to a catalog that uses anonymous access for the catalog pages. If you select Don’t rewrite URLs, the URLs for catalog items are pointed directly to the library item of the connected catalog.

Loading Behavior

Select when the search results returned by the Search Results Web Part appear on the web page. The default option is Async option: Issue query from the browser. Queries will be issued from the end-users browser after the complete page is received. This option may be considered for secondary content on a page — for example, Recommendations or Popular Items. If you select Sync option: Issue query from the server, queries are issued from the server, and the search results are included in the page response that is sent back from SharePoint.

On the TEST tab, you can preview the query that is sent by the Search Results Web Part.

Query text

Shows the final query that will be run by the Search Results Web Part. It is based on the original query template where dynamic variables are substituted with current values. Other changes to the query may be made as part of a query rule.

Click Show more to display additional information.

Query template

Shows the content of the query template that is applied to the query.

Refined by

Shows the refiners applied to the query as defined on the REFINERS tab.

Grouped by

Shows the managed property on which search results should be grouped as defined on the REFINERS tab.

Applied query rules

Shows which query rules are applied to the query.

The Query template variables section shows the query variables that will be applied to the query, and the values of the variables that apply to the current page. You can type other values to test the effect they will have on the query. Click the Test Query button to preview the search results.

You can also test how the query works for different user segment terms. Click Add user segment term to add terms to be added to the query.

Click the Test query button to preview the search results.

Query text

Shows the final query that will be run by the Search Results Web Part. It is based on the original query template where dynamic variables are substituted with current values. Other changes to the query may be made as part of a query rule.

In the Web Part tool pane, in the Display Templates section, the default selection is Use result types to display items. This selection will apply different display templates according to the result type of the search result. For example, if the result type of a search result is a PDF file, the display template PDF Item will be applied. If the result type of a search result is an image, the Picture Item display template will be applied. To apply one display template to all result types of the search results, select Use a single template to display items, and then select the display template that you want to apply.

In the Web Part tool pane, in the Settings section, in the Results Settings, to further specify how search results should be shown, change the values in the following fields:

Number of results per page The number of search results to be displayed per page.

Show ranked results Clear the check box if you want to show only promoted blocks (such as promoted results or personal favorites) or result controls (such as result counts) instead of the ranked results.

Show promoted results Clear the check box if you do not want to show search results that you have promoted by using Query rules.

Stemming means that nouns and adjectives in a query are expanded to different possible inflections. For example, if a person enters the English word "foot" in a query, it is automatically expanded to {"feet"}. Similarly, the word "overview" is expanded to {"overviews"}.

To disable stemming in a Search Results Web Part

Verify that the user account that performs this procedure is a member of the Designers SharePoint group on the Enterprise Search Center site.

On the search results page, click the Settings menu, and then click Edit page.

In the Search Results Web Part, click the Search Results Web Part Menu arrow, click Export…, and then save the Web Part to your computer.

Open the Web Part in a text editor — for example, Notepad.

Change the value for EnableStemming to false, and then save the file with a new name — for example, Search_Results_NoStemming.webpart.

On the search results page, in the Main Zone, click Add a Web Part.

In the Categories section, click the Upload a Web Part arrow.

In the Upload a Web Part section, click Browse to find the Web Part file that you have edited, and then click Upload.

To add the customized Search Results Web Part to the search results page, do the following:

Browse to the search results page.

Click the Settings menu, and then click Edit Page.

In the Web Part Zone where you want to add the Web Part, click Add a Web Part.

In the Categories list, select Imported Web Parts.

In the Parts list, select the Web Part that you uploaded, and then click Add.

To remove the default Search Results Web Part from the search results page, do the following:

Browse to the search results page.

Click the Settings menu, and then click Edit Page.

In the Web Part, click the Search Results Web Part menu arrow, and then click Delete.

Note:

Disabling stemming turns it off for all languages except the following: Arabic, Estonian, Finnish, Hebrew, Hungarian, Korean, Latvian, and Slovak.