Showing posts from July, 2015

Lucene Highlighter Tutorial with Example

The post explains how to implement search terms Highlighter using Apache Lucene 5.1 along with example code. When users search, they want to search in minimum time. So the techniques that facilitate users to search fast are important for better user search experience, highlighter is one of those techniques. HighLighter performs two functions: It makes the terms bold in search result which were part of user query, so that user can identiy and quickly review the result. If your document text is long, Highlighter also select best fragment of text that contains the search keywords, so that user could read 2-3 lines of document to decide whether exploring the link further would help. Using Google, you must have noticed, Google highlight the query keywords making them bold and also select a particular fragment of text from the description that is stored in Google about that articles. As show below: Notice, there are three query terms: java, inheritance and bitspedia. In re