lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabiano Nunes <fabi...@nunes.me>
Subject Retrieving payload attribute in highlighter
Date Tue, 30 Nov 2010 15:20:02 GMT
Hello,
I'm trying to retrieve payloads from the highlighteds terms by Highlighter
class. In my tests, all terms returned from Highlighter has null as payload.
Example:

Highlighter h = new Highlighter(new Formatter() {
public String highlightTerm(String originalText, TokenGroup tokenGroup) {
Token token = tokenGroup.getToken(0);
 Payload payload = token.getPayload();
 assertNotNull(payload); // <---------------- payload is always null
 return originalText;
}
}, scorer);

It seems that Highlighter removes payload attribute from all terms before
creating its TokenGroup.
How can I preserve it?

Thanks.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message