Returns: highlighted text fragment or null if no terms foundSo it is important to have handling in your code and not just expect that there will be an output from this method.
Software development blog focusing on the Sitecore Experience Platform and Sitecore Experience Commerce.
Wednesday, March 9, 2016
Sitecore Lucene getBestFragment returning null with search results highlighting
I have been using the getBestFragment method of the highlighter class available through the Lucene contirb library - to highlight the search term(s) on the search results page. It worked as expected in most cases, however I noticed that some results were returning as null. After looking through the documentation, I found out that:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment