Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6605

Set payloads in token within TokenGroup in Highlighter

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.2.1
    • None
    • None
    • New

    Description

      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);

      Attachments

        Activity

          People

            Unassigned Unassigned
            robert.onslow@8newsquare.co.uk robert.onslow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: