lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terje Eggestad (Commented) (JIRA)" <>
Subject [jira] [Commented] (LUCENE-2587) Highlighter picks wrong offset for fragment boundaries
Date Fri, 04 Nov 2011 08:53:00 GMT


Terje Eggestad commented on LUCENE-2587:

Hi Steve

You want to include it in future releases? Do me a favor and clean it up a bit so I don't
look completely incompetent :-)
You'd need to add an option for paragraph demarcation. 
Also added the Test class for the Fragmenter. The test text need to be replaced, it's an excerpt
from a copyrighted news paper article...
(You should have an english text anyway)

> Highlighter picks wrong offset for fragment boundaries
> ------------------------------------------------------
>                 Key: LUCENE-2587
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: modules/highlighter
>    Affects Versions: 3.0.2
>         Environment: Java 6 + Lucene 3.0.2
>            Reporter: Terje Eggestad
>            Priority: Trivial
>              Labels: newdev
>         Attachments:, LUCENE-2587.patch,
> I have written  a new Fragmenter since we need fragments for hitlines to be on sentence
boundaries and not cross paragraphs. 
> When using it with, I get hitlines that
starts with ". ", "? ", "! "...
> Consider the text  "A b c d e. F g h i j! K l m n o. " 
> which become the tokenstream : (A) (b) (c) (d) (e) (F) (g) (h) (i) (j) (K) (l) (m) (n)
> If the fragmenter return isNewFragment()  = true on F and K and Highlighter pick the
middle fragment, lets say we search on "g" the hitline becomes:
> ". F <B>g</B> h i j"
> The reason, it seems, is that the offset to the fragment boundaries found by taking the
endOffset of the last token in a fragment , 
> not the startOffset of the first. 
> TJ

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


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

View raw message