robert.onslow created LUCENE-6605:
-------------------------------------

             Summary: Set payloads in token within TokenGroup in Highlighter
                 Key: LUCENE-6605
                 URL: https://issues.apache.org/jira/browse/LUCENE-6605
             Project: Lucene - Core
          Issue Type: Improvement
    Affects Versions: 5.2.1
            Reporter: robert.onslow


I have a tokenizer which sets the payload attribute and which drives the 
highlighter. In Formatter.highlightTerm() I need to examine that payload on the 
token. However TokenGroup.addToken() doesn't currently set the payload on the 
token which is created and fed through to Formatter.highlightTerm() within the 
TokenGroup.

I would suggest, TokenGroup.addToken():

token.setPayload(payloadAtt.getPayload());

having of course registered the payload attribute during initialisation of 
TokenGroup with:

payloadAtt = tokenStream.addAttribute(PayloadAttribute.class);






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to