lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley (JIRA)" <>
Subject [jira] [Created] (LUCENE-6139) TokenGroup.getStart|EndOffset should return matchStart|EndOffset not start|endOffset
Date Fri, 26 Dec 2014 04:27:13 GMT
David Smiley created LUCENE-6139:

             Summary: TokenGroup.getStart|EndOffset should return matchStart|EndOffset not
                 Key: LUCENE-6139
             Project: Lucene - Core
          Issue Type: Bug
          Components: modules/highlighter
            Reporter: David Smiley

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

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

View raw message