Skip to end of metadata
Go to start of metadata
Icon

Since the September 2016 release of Coveo for Sitecore, there is a simpler method to control which sections of your HTML is indexed (see Ignoring Specific HTML Sections from an Item Body).

To hide sections from the index completely, for instance to prevent queries from being triggered during the indexation, the current method is better suited.

You might want to control exactly which content is available when enabling full-text search on an item. To enable full-text search on an item, you must provide a quick view representation for this particular item. When using the HTML content processor method, you can decide which content is displayed in the quick view and thus control exactly which content is available (see Configuring the HTML Content Processor).

 You can use your website layout for the quick view, but remember that any text that is displayed on the page will be indexed. You might thus want to hide menus and banners to keep only the relevant information.

The recommended approach is to use a separate layout and device for the quick view. Since only the text is indexed, the quick view page might only contain text content. You could also add a specific device for the quick view that detects the user agent used for crawling (see Creating the Quick View Device). The quick view page also allows you to set meta tags that add content to item fields. Those fields could then be used for sorting or faceted searches (see Adding Meta Information on Quick View).

Adding a Specific Quick View Layout 

This is a fairly common operation in Sitecore:

  1. Open the Sitecore Content Editor and select the /sitecore/Layout/Layouts item.
  2. You are encouraged to use a project specific folder for the new layout. To do so, right-click and select Insert > Layout FolderGive the new folder a meaningful name.
  3. Right-click on the folder and select Insert > Layout.
  4. Follow the wizard steps. A new file will be created in the layouts folder of the web site. You could modify it to suit your needs. The default path is C:\inetpub\wwwroot\<sitecore instance name>\website\layouts.

To make your layouts more manageable, you can define new sublayouts that are template-specific. This way, you can reuse the Quick View Layout for many items.

Creating the Quick View Device 

  1. Open the Content Editor and select the item /sitecore/Layout/Devices.
  2. Right-click and select Insert > Device.
  3. Give it a meaningful name, such as Quick View.
  4. Activate the Content tab and find the Browser agent field in the Detection section.
  5. Set the value to Coveo Sitecore Search Provider.

You just enabled an additional device to be used later on by Coveo to fetch an item quick view.

Setting Item Preview Layout  

  1. Open the Content Editor and select a template for which you want to enable the Preview feature.
  2. When you expand the desired template, you will see a sub item named __Standard Values. Select it.
  3. Click the Presentation tab in the top of the window, and then click the Details button.
  4. Next to the Quick View device, click the [No layout specified] link.
  5. Select the Quick View Layout from the tree.
  6. If you are using any sublayout that is specific to the template, follow these steps:
    1. Click the Edit button. A new window will appear.
    2. Click the Controls list item on the left.
    3. To add a sublayout, click the Add button and then select the desired sublayout from the tree.
    4. Type in the name of the placeholder in the Add to Placeholder text box. The default placeholder name in the samples is content.

The template instances now shows something in Preview mode. To see an item in Preview mode, follow these steps:

  1. Open the Page Editor and navigate to the desired item.
  2. Click the Preview button to enter the preview mode.
  3. The preview will use the Default device. Click the Default button and select the Quick View device.

Configuring the HTML Content Processor 

  1. On the Sitecore instance server, open the Coveo.SearchProvider.Custom.config file. By default, the file is located in C:\inetpub\wwwroot\<sitecore instance name>\Website\App_Config\Include.
  2. Find the coveoPostItemProcessingPipeline element.
  3. Add the following processor element:  

    Icon

    When your Sitecore items can only be accessed by being authenticated, you need to configure form authentication to be able to index their HTML content (see Configuring Form Authentication).

In order to have Quick View on items, make sure to publish all items to the web database. For more information, see Constraints and Limitations.

Adding Meta Information on Quick View 

It is also possible to set specific field values on items when using the quick view. It allows, for instance, to set field values on an item when rendering a sub item. To add metadata to an item quick view, you only need to output tags like this one:

The meta element does not need to be placed in the page head; you can place it anywhere. When indexing the item, the field theFieldName is given the value The Field Value in the index for the item. Please note that the meta name must match the Sitecore field name.

Constraints and Limitations 

There are currently some limitations when this method is used.

  • In order to get a quick view on an item, the following conditions must be met:
    • The item must have a layout so the item preview is displayed correctly in Sitecore.
    • The item preview must be available anonymously.
  • The quick view contains the item data coming from the web database regardless of the database it belongs to. The returned results are accurate when searches are performed on the web database. When performing full-text search on the master database, results match the item data that is in the web database. Please note that this does not affect item permissions.
  • If a Sitecore item is secured (cannot be accessed anonymously), Coveo will not be able to get the quick view for that item.
  • When adding meta information on the quick view, a Sitecore field with the same name must exist. Otherwise, the meta element is ignored.