Product DocsMenu

Configuring SharePoint Search Scopes

Coveo .NET Front-End 12.0.960+ (September 2014)

SharePoint 2016 (Coveo .NET Front-End 12.0.1633+ (September 2016)), 2013, and 2010 allow SharePoint administrators to define search scopes to allow users to choose to limit their searches to certain criteria such as locations or content marked with particular property values (see Microsoft article Define scopes for searches).

A SharePoint site administrator can define SharePoint scopes even with limited access to SharePoint front-end servers. SharePoint scopes are saved directly in the SharePoint database at the site collection level. Along with the scopes themselves, a default scope configuration can be created at the site collection level. SharePoint scopes are sent to the CES index at query time, as query expressions. Because SharePoint scopes exist only in SharePoint, they can only be used from inside SharePoint pages. A Coveo search page not integrated to SharePoint cannot use them.

Note: The support for SharePoint scopes is different from the Coveo search scope that are defined on the Coveo Master server (see Administration Tool - Search Scopes Menu) and used in Coveo .NET Front-End user interfaces (see Configuring the Scope of a .NET Search Interface). An administrator managing Coveo search scope must have access to Coveo Administration Tool and the Coveo .NET Front-End Interface Editor.

Functionally speaking, SharePoint scopes behave similarly to Coveo search scopes. In SharePoint, they appear in the scope drop-down list beside the Coveo search box and in the Search In facet in the results page. When a user selects a SharePoint scope, documents are filtered in or out according to the SharePoint scope configuration.

To configure SharePoint Search Scopes

  1. Ensure that Coveo .NET Front-End version 12.0.960+ (September 2014 monthly release) is installed on your SharePoint server (see Installing the Coveo Web Service, Search Box, and Search Interface into SharePoint).

  2. Access SharePoint with a site administrator account.

  3. In any SharePoint page containing a Coveo search box, click the gear icon next to the search box, and then select one of the following options:

    • Current site collection's scopes to define or modify the default site collection scopes used by default by every site.

    • Current site's scopes ([SiteName]) to define a scope configuration applicable only to the current site ([SiteName]), overriding the inherited default.


    • Alternately, in a Coveo .NET Front-End search interface integrated in SharePoint, from the Do more menu, you can select the same options.

    • The gear icon and the Do more menu Current site collection's scopes option are not available to non administrator users.

  4. In the Search Scopes (Site Collection Default) or Search Scopes (Current Site) dialog box, you can perform various actions. 

    • To use default scopes for a specific site, select the Use default scopes (site collection) option.

    • To specify which scopes are available to end-users, in the Name column, select the checkbox in front of the scope(s) names to make available.

    • To specify the default scope, in the Default column, select the appropriate scope.

    • To make selected scopes visible to end-users:

      • Select the Show scope selector drop-down next to search box option to make scopes available in SharePoint from a list next to the search box.

        Note: By default, the following standard scopes are not included in the scope selector drop-down: All SharePoint, Current SharePoint site, Current SharePoint top level site, All Results, and all the search scopes defined in the Administration Tool (see What Are Search Scopes?) .

        To include these scopes in the scope selector drop-down, you must edit the SearchBox.ascx file of the SharePoint skin:

        1. With an account that has administrator rights, access the SharePoint server.

        2. Open the SearchBox.ascx file with a text editor.

          Depending on your SharePoint version, the file is located in C:\Program Files\Coveo .NET Front-End 12\Web\Coveo\Skins\SharePoint 2010 or in C:\Program Files\Coveo .NET Front-End 12\Web\Coveo\Skins\SharePoint 2013.

        3. Remove the following method from the file:

              protected override void OnInit(EventArgs p_Args)
                  ISearchBox sb = Parent.Parent as ISearchBox;
                  if (sb != null) {
                      sb.ShowStandardScopes = false;
        4. Save the file.

      • Select the Show scope selector facet in search interface option to make scopes available in the Search In facet of a Coveo .NET Front-End search interface integrated in SharePoint.

    • To create a new scope or edit an existing one:

      Click Create Scope to create a new scope or click the Edit Scope icon to edit an existing one, and then in the Search Scope Modification dialog box, configure the scope: 

      1. In the Name box, enter a meaningful name for the scope. End-users will see this name in the lists of available SharePoint scopes.

      2. In the Description box, optionally enter a description for the scope. This information is only visible to administrators.

      3. Click Add Rule when you want to add a new rule to the scope.

      4. In the Rules list, for each rule: 

        1. In the first column, select one of the available rule types: 

          • Web Address

            A web address rule is used to restrict the scope to only search from a specific SharePoint server part.

            Example: You enter to create a scope restricted to human resources content.

          • Field

            A field rule is used to match the documents for which a given field has a specific value. In a field rule, you can only use fields for which the Include for field queries option is selected in the Administration Tool (see Adding or Modifying Custom Fields). While you type the field name, an auto completion pop up window suggests the available field names matching typed characters.

            Example: A scope with the following field rule would return only PDF files.

            @sysfiletype = pdf

          • Free Text

            The free text rule value is added as-is to the query sent to the index. Only documents containing the entered keywords are returned. If more than one word is specified, only the documents that contain all the words are returned.

            The free text rule can be particularly useful to enter more complex queries using various query syntax elements (see Coveo Query Syntax Reference).

            Example: A scope with the following query, using fields and a Boolean operator, would return only PDF files from the Engineering site.

            @sysspsitename="Engineering" AND @sysfiletype="pdf"

        2. In the middle column of the list, enter or select appropriate values for the rule type.

        3. In the second-to-last column, select the action determining how each rule combines with others to form the final scope: 

          • Require (AND)

            Use this action to narrow search results to documents matching the rule criteria.

          • Include (OR)

            Use this action to expand search results by adding documents matching the rule criteria.

          • Exclude (NOT)

            Use this action to narrow search results by excluding documents matching the rule criteria.

        4. Click the Delete Rule icon to delete a rule from the scope.

      5. Click Save to save your scope configuration.

    • To delete an existing scope, click the Delete Scope icon for the scope.

    • Click Apply to make your search scope changes effective.

People who viewed this topic also viewed