You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/01/04 00:23:34 UTC
[jira] [Commented] (LUCENE-6139) TokenGroup.getStart|EndOffset
should return matchStart|EndOffset not start|endOffset
[ https://issues.apache.org/jira/browse/LUCENE-6139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14263669#comment-14263669 ]
ASF subversion and git services commented on LUCENE-6139:
---------------------------------------------------------
Commit 1649263 from [~dsmiley] in branch 'dev/trunk'
[ https://svn.apache.org/r1649263 ]
LUCENE-6139: TokenGroup start/end offset getters should have been returning offsets of matching tokens when there are some.
Also made the Highlighter use the getters instead of direct field access.
> TokenGroup.getStart|EndOffset should return matchStart|EndOffset not start|endOffset
> ------------------------------------------------------------------------------------
>
> Key: LUCENE-6139
> URL: https://issues.apache.org/jira/browse/LUCENE-6139
> Project: Lucene - Core
> Issue Type: Bug
> Components: modules/highlighter
> Reporter: David Smiley
> Attachments: LUCENE-6139_TokenGroup_offsets.patch
>
>
> The default highlighter has a TokenGroup class that is passed to Formatter.highlightTerm(). TokenGroup also has getStartOffset() and getEndOffset() methods that ostensibly return the start and end offsets into the original text of the current term. These getters aren't called by Lucene or Solr but they are made available and are useful to me. _The problem is that they return the wrong offsets when there are tokens at the same position._ I believe this was an oversight of LUCENE-627 in which these getters should have been updated but weren't. The fix is simple: return matchStartOffset and matchEndOffset from these getters, not startOffset and endOffset. I think this oversight would not have occurred if Highlighter didn't have package-access to TokenGroup's fields.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org