The highligher contrib package does what you're looking for:
http://svn.apache.org/repos/asf/lucene/java/trunk/contrib/highlighter/
By default it breaks the document into chunks roughly 100 characters
long. You can alter it to get tens words either side of the matched
term.
--
Miles Barr <[EM
Since you own Lucene in Action, look at this:
http://www.lucenebook.com/search?query=highlighter+context
See section 8.7, Highlighting query terms.
Otis
--- Andy Roberts <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've been using Lucene for a few months now, although not in a
> typical
> "building a
Hi,
I've been using Lucene for a few months now, although not in a typical
"building a search engine" kind of way*. Basically, I have some large
documents. I would like a system whereby I search for a term, and then I
receive a hit for each match, with its context, e.g., ten words either side