lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <>
Subject Re: how to get the snippet?
Date Mon, 01 Aug 2005 17:21:24 GMT

If you want highlighting like this:
or like this:

Then you'll want to pull Lucene directly from SVN, and look in the
contrib/ directory, where you'll find classes for highlighter.  You can
then build a Jar for the highlighter and use it in your app.  The API
is simple (you can download the code from the Lucene book and see how
it's done).


--- Riccardo Daviddi <> wrote:

> Hy all,
> which is the way to get a snippet of a query?
> Does Lucene offer some explicit methods?
> If is not so, it's possible to know the position of the matched
> keyword in the query into the field of the doc, so that I can take
> some words before and after the keyword to create the snippet?
> Or there is a smarter way to get the snippet?
> thx in advance!
> -- 
> Riccardo Daviddi
> University of Siena - Information Engeneering
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message