lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <>
Subject Re: Hits document offset information? Span query or Surround?
Date Tue, 06 Sep 2005 07:11:01 GMT
On Tuesday 06 September 2005 08:21, Sean O'Connor wrote:
> I believe I have heard that Span queries provide some way to access 
> document offset information for their hits somehow. Does anyone know if 
> this is true, and if so, how I would go about it?
> Alternatively (preferably actually) does the surround code from the SVN 
> development area have a way of returning offsets for the matching hits?

Using getSpans(reader) on the span query will provide the Spans that
match the query. A Spans iterates through begin/end offset pairs within 
the matching docs. This is provided by Lucene.

> I believe the current highlighter code matches all query terms in a hit 
> document, not just those satisfying a query criteria. I need a more 
> precise way to access the hit term offsets. I am working on hit 
> highlighting, hit excepts and summaries, and compound queries  (is this 
> called search vectors?). I am still working through the surround code in 
> dev. to see if that gives me the compound queries I need.
> I am willing to spend a few days to work on implementing adding offsets 
> to the returned hits (or something similar) if this is not currently 
> available. It is something I need, even at the cost of search efficiency.

See also the thread on better highlighting that started on 25 August
and this:

Paul Elschot

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

View raw message