You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Steven Rowe (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2011/11/06 15:10:51 UTC
[jira] [Issue Comment Edited] (LUCENE-2587) Highlighter picks wrong
offset for fragment boundaries
[ https://issues.apache.org/jira/browse/LUCENE-2587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13143938#comment-13143938 ]
Steven Rowe edited comment on LUCENE-2587 at 11/6/11 2:10 PM:
--------------------------------------------------------------
Hi Terje,
Thanks for posting your code and a test - I'll take a look. My initial interest is seeing how your code triggers the highlighting bug. I think the ideal way to proceed is create a test fragmenter based on but simpler than your fragmenter, to trigger the bug, and then fix the bug. Roberto may have already essentially done all of this - I haven't had a chance to look at his patch yet.
Once that's all done, I think it's appropriate to create a new issue for your sentence fragmenter, since that would be a great addition to Lucene!
Thanks again,
Steve
was (Author: steve_rowe):
Hi Terje,
Thanks for posting your code and a test - I'll take a look. My initial interest is seeing how your code triggers the highlighting bug. I think the idea way to proceed is create a test fragmenter based on but simpler than your fragmenter, to triggers the bug, and then fix the bug. Roberto may have already essentially done all of this - I haven't had a chance to look at his patch yet.
Once that's all done, I think it's appropriate to create a new issue for your sentence fragmenter, since that would be a great addition to Lucene!
Thanks again,
Steve
> Highlighter picks wrong offset for fragment boundaries
> ------------------------------------------------------
>
> Key: LUCENE-2587
> URL: https://issues.apache.org/jira/browse/LUCENE-2587
> 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: IMSentenceFragmenter.java, LUCENE-2587.patch, TestIMSentenceFragmenter.java
>
>
> 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 org.apache.lucene.search.highlight.Highlighter, 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) (o)
> 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org