Wednesday, March 9, 2016

Sitecore error when highlighting search keywords with Lucene

When referencing the Lucene.Net DLL that comes out of the box with Sitecore (version 7 or 8 with my tests), you will encounter the following error when attempting to highlight the search keywords.
Method not found: 'System.Collections.Generic.ISet`1<!!0> Lucene.Net.Support.Compatibility.SetFactory.CreateHashSet()'.
This is because the version used with Sitecore is not compatible with the Lucene contrib libraries. This library which is maintained by contributors with special rights includes the highlight functionality (among other features such as spellchecker).
The solution to this problem is to head over to the Lucene.Net nuget package and grab the latest package from there (version 3.0.3 as of time of writing this post) and deploy the Lucene.Net DLL over the version that is included with Sitecore.

No comments:

Post a Comment