[
https://issues.apache.org/jira/browse/LUCENE-5166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13736966#comment-13736966
]
Robert Muir commented on LUCENE-5166:
-------------------------------------
Well the patch doesnt attempt to change anything about the breakiterator logic:
so your test is "valid" but testing something different.
Let me try to explain:
The bug Manuel found here is "matching term spanning the content boundary". so
lets call this "truncated term". This patch fixes this so formatter doesnt have
to deal with it, and there is no AIOOBE or strange checks in the formatter.
The test you write is for different behavior: it saying, if the passage itself
spans the content boundary, don't present it to the formatter at all. But, this
is sorta a different issue, its already handled here today by Math.min and the
formatter never has to deal with it:
{code}
// advance breakiterator
assert BreakIterator.DONE < 0;
current.startOffset = Math.max(bi.preceding(start+1), 0);
current.endOffset = Math.min(bi.next(), contentLength);
{code}
If we want to change the behavior for this, thats cool too, but its not really
related to the bug at hand. I am not opposed to fixing it, but one problem
would be someone using stuff like WholeBreakIterator, though we could "solve"
it in a different way by having WholeBreakIterator take in the limit itself (I
dont know if this would address your concern though).
> PostingsHighlighter fails with IndexOutOfBoundsException
> --------------------------------------------------------
>
> Key: LUCENE-5166
> URL: https://issues.apache.org/jira/browse/LUCENE-5166
> Project: Lucene - Core
> Issue Type: Bug
> Components: modules/highlighter
> Affects Versions: 4.4
> Reporter: Manuel Amoabeng
> Attachments: LUCENE-5166-2.patch, LUCENE-5166.patch,
> LUCENE-5166.patch, LUCENE-5166.patch, LUCENE-5166.patch, LUCENE-5166.patch
>
>
> Given a document with a match at a startIndex < PostingsHighlighter.maxlength
> and an endIndex > PostingsHighlighter.maxLength, DefaultPassageFormatter will
> throw an IndexOutOfBoundsException when DefaultPassageFormatter.append() is
> invoked.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]