Breaking changes for Optimizely Search & Navigation 17
Optimizely Search & Navigation 17 changes the names of indexed fields and the signatures of several interfaces you can implement or extend. Review these breaking changes before you upgrade so that your code compiles and your queries return the results you expect.
Integer and other field types use new type suffixes
Optimizely Search & Navigation appends a type suffix, such as $$string or $$date, to the name of each field it indexes. Version 17 changes the suffix for integer types and adds suffixes for more types:
- Integer and enum fields – int, short, long, byte, sbyte, uint, ushort, ulong, and enum fields use $$long instead of $$number. float, double, and decimal fields still use $$number.
- Guid, TimeSpan, DateTimeOffset, and char fields – These fields use $$string.
- Array fields – Array fields use the suffix of their element type.
If your code refers to suffixed field names as strings, such as MyInt$$number, update those names.
After you upgrade, fully reindex existing content and other indexed objects so they use the updated field names. For CMS content, run the Episerver Find Content Indexing Job from CMS admin mode. Queries using the renamed fields can miss documents that still use the old field names until you reindex them.
ILocalizable language fields use renamed index fields
Search & Navigation 17 indexes the language fields of ILocalizable content under new names:
- LanguageName – Replaces Language.Name.
- MasterLanguageName – Replaces MasterLanguage.Name.
In your queries, replace x.Language.Name with the x.LanguageName() extension method, and x.MasterLanguage.Name with x.MasterLanguageName().
IContentIndexer adds a ReIndexAsync method
IContentIndexer has a ReIndexAsync method, the asynchronous version of ReIndex. If you implement IContentIndexer directly, add the following method:
Task<ContentIndexer.ReIndexResult> ReIndexAsync(
SiteDefinition siteDefinition,
Action<ContentIndexer.ReIndexStatus> statusAction,
Func<bool> isStopped,
DateTime? startTime);If your class inherits from ContentIndexer, you do not need to change it. You can override ReIndexAsync to customize it.
IShouldIndexInContentAreaConvention.ShouldIndexInContentArea signature change
IShouldIndexInContentAreaConvention.ShouldIndexInContentArea takes an IContentData parameter instead of IContent, so that conventions can evaluate inline blocks in content areas. The ShouldIndexInContentAreaConvention constructor also takes a Func<IContentData, bool?> instead of a Func<IContent, bool?>. Update any custom convention that implements the interface or passes a delegate to the constructor.