Category: ‘Lucene’

Lucene Query Syntax for SQL

Aug 02 2011

Lucene provides a rich query syntax allowing users to easily create simple queries and scale up to complex ones. A number of search back-ends are built on top of Lucene nowadays such as ElasticSearch and Solr. In this article we will explore using Lucene’s query syntax against relational databases. We used Groovy here, but it […]

Highlight text using Lucene

Mar 06 2011

The following code illustrates how to use the Lucene highlighter to highlight text in any String.

This code will wrap matching values with a bold tag. Example usage is as follows: java -cp LuceneHighlighter http://site/index “words”