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

Set payloads in token within TokenGroup in Highlighter

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Lucene Fields:
      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

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

              Dates

              • Created:
                Updated: