lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <>
Subject Re: Making Highlighter.mergeContiguousFragments() public
Date Tue, 23 Oct 2007 16:56:48 GMT
Ahhh....the reason the second Shapes is not highlighted is that the 
Highlighter highlights based on what caused the hit in Lucene...and 
Lucene does not look for every shape within 4 paragraphs of 
distribution...after it finds one such occurrence it says "sweet, a 
match" and moves does not look for another such match. If there 
where another occurrence of distribution on the other side of the last 
Shapes, then it would cause its own match. This may be because of how I 
have implemented my WithinSpanQuery or it may be how Span queries in 
lucene work in general. I will investigate and let you know. I am 
thinking that Lucene just quits after finding the span its looking says ok I found distribution, now find shape within 4 
paragraphs after distribution...okay found it...I don't think it then 
says there another shape after that shape within 4...and then 
another and another?

Ill look into it further. Certainly though , other than this possible 
oddity...everything is working.

- Mark

Dave Golombek wrote:
> I was wondering if people thought that making
> Highlighter.mergeContiguousFragments() public (and non-final) would be
> acceptable. In my application, I want to strip all fragments with score == 0
> before merging the fragments (to get the minimal matching section, but still
> in order), and the easiest way to do so would be to override that method.
> Not a big deal, but I thought other people might find it useful. Making the
> method public static would also achieve the same result, allowing me to call
> the function separately.
> Thanks,
> Dave Golombek
> Black Duck Software, Inc.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message