Advanced Indexing Customizations
- Using Pipelines
- Creating Computed Fields
- Overview of Field Management in the Coveo.SearchProvider.config File
- Use Separate Security Identity Providers per Sitecore Index
- Changing the Name of Sources Created in the Coveo Index
Creating 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 is 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 fieldNames hint=”raw:AddFieldByFieldName”.
- 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 instance, you may want to display it in a search interface.
Computed index field code is executed at indexing time. If the code is not 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: