lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tatu Saloranta <>
Subject Re: New highlighter package available
Date Thu, 02 Oct 2003 03:52:50 GMT
On Wednesday 01 October 2003 18:26, Otis Gospodnetic wrote:
> Korfut,
> I don't have the time to spend more time on this, but one thing is
> confusing me here.  Mark provided a set of several classes that are
> supposed to make hit highlighting possible.  I have not tested them,
> but for certain reasons I believe the code works as advertized.
> Why does that code not work for you, that you need additional changes
> to core Lucene to do hit highlighting?

>From what I remember when doing similar patches to Lucene core, alternative
way (not adding any new support) requires one to dig deep into implementation
details of Lucene term and query objects, breaking encapsulation.
>From design standpoint core is/was lacking sufficient support to allow for 
clean highlight implementation. Some query objects didn't have proper access 
methods; those that had needed to be cast to specific type as base classes 
didn't have generic Term collecting/accessing methods.

However, changes/additions to core are fairly small in scope (some access 
changes; adding couple of generic Term accessor methods), so hopefully 
patches won't be too controversial (and may be useful for other things like 
perhaps just listing all Terms query expands to in index, for debugging).

As to term collecting, I think there were 2 approaches; either collect them 
during query execution, or as a separate step. First is likely to be more 
efficient (esp. for wildcard queries), but may also impose some overhead
(time/mem usage) in cases where highlighting is not needed.
I implemented second approach, using visitor pattern (or similar), and I think 
Korfut implemented first approach, in a way that term collection could be 
enabled/disabled per Query object.

-+ Tatu +-

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

View raw message