Lucene SpanQuery - what is it good for?

Spans provide a proximity search feature to Lucene. They are used to find multiple terms near each other, without requiring the terms to appear in a specified order. You can specify the terms that you want to find, and how close they must be. You can combine these span queries with each other or with other types of Lucene queries.


Found this all about the SpanQuery


A span query is a query that returns infomation about where in a document each match took place. You use the getSpans() method to get the locations.

The following deck of slides (unfortunately in Powerpoint) contain an example: http://www.cnlp.org/apachecon2005/AdvancedLucene.ppt

Tags:

Lucene