- About Sitecore, Coveo for Sitecore, and Coveo Fields
- Special Character Translation in Field Names
- About the Search Result Title Selection Sequence
- Understanding How Coveo for Sitecore Resolves the Site for the Clickable URI
- Specify Which Fields to Index
- Change the Settings of Sitecore Fields
- Create Computed Fields
Create Computed Fields
Computed fields allow you to add new fields in your search indexes. Ultimately, this means that you will end up with additional fields in your Coveo index, in addition to those of Sitecore.
A computed field is processed for every Sitecore item that gets re-indexed.
A computed field is normally used to add complementary information to indexed Sitecore items.
A computed field must be implemented using custom C# code. Since it’s executed in the context of Sitecore, you can take advantage of using the Sitecore API.
The more complex a computed field logic is, the slower to process it will be.
Implementing a Computed Field
There are essentially four different steps required when you implement a computed field:
Implement the computed field using custom C# code (you must implement the
Add the computed field in the
Coveo.SearchProvider.Custom.configfile. It must be added under
Rebuild your search indexes, or at least re-index the Sitecore items that need your new field.
Use the new field in whatever way is needed. For example, you may want to display it in a search interface.
Computed index field code is executed at indexing time. If the code isn’t optimized, it can slow down the whole indexing process.
Avoid running HTTP requests
Avoid querying a search index
Here are complete tutorials showing you how to implement and use a computed field: