Indexing With the BasicHtmlContentInBodyProcessor
Indexing With the BasicHtmlContentInBodyProcessor
This method is the simplest way to enable full-text search on Sitecore items.
When indexing a Sitecore item, an HTML representation is generated containing the field names and values. This HTML content is then used for full-text search as well as for the Quick view.
Note that the basic HTML content processor returns the raw value of a field directly, not the rendered value. This means that you can’t use it to add the rendered value of a computed field to the HTML representation.
Configuring the Basic HTML Content Processor
-
Open the
Coveo.SearchProvider.Custom.config
file in a text editor. By default the file is located in<SITECORE_INSTANCE_ROOT>\website\App_Config\Include\
. -
Locate the
coveoPostItemProcessingPipeline
element (see Understanding the coveoPostItemProcessingPipeline Pipeline). -
Insert the following processor sub-element right under:
<processor type="Coveo.SearchProvider.Processors.BasicHtmlContentInBodyProcessor, Coveo.SearchProviderBase"/>
-
Re-index the Sitecore items (Sitecore Desktop > Control Panel > Indexing > Indexing Manager).
-
You can now perform full-text search on this HTML content.
Options on the Processor
A few options are available on the processor:
Name | Description | Example value |
---|---|---|
IncludeFieldNames |
Whether the field names should be added to the HTML content or not. |
true /false
|
IncludeTextFieldsOnly |
Whether to add only text fields in the HTML content (for example, Single-Line Text, Multi-Line Text). |
true /false
|
FieldsToInclude |
Comma-separated list of fields to include. | Name,DisplayName |
TemplatesToInclude |
Comma-separated list of templates to include. | Sample Item,Device |
Options can also be configured using the following code block, still under the coveoPostItemProcessingPipeline
element in the Coveo.SearchProvider.Custom.config
file:
<processor type="Coveo.SearchProvider.Processors.BasicHtmlContentInBodyProcessor, Coveo.SearchProviderBase">
<IncludeFieldNames>false</IncludeFieldNames>
</processor>