lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arpad KATONA" <>
Subject Highlighting, startOffset, endOffset
Date Mon, 12 May 2003 07:43:03 GMT
Hello Lucene Users,

in order to highlighting terms in a text, i try to use Maik Schreiber's highlighting solution
see "Term Highlighter" on : .
It is based on the "startOffset" and "endOffset" functions of the "org.apache.lucene.analysis.Token"
class, see the short code sample below.

org.apache.lucene.analysis.Token token;
TokenStream stream = analyzer.tokenStream(new StringReader(text));
while ((token = != null) {
  int startOffset = token.startOffset();
  int endOffset = token.endOffset();

The problem is, that these functions "startOffset" and "endOffset" seem to return always 0,
do you see why? In the mails archive there is only one mail that treats this thema :
From: Tom Dunstan
Subject: Excerpts
Date: Tue, 1 Oct 2002 12:19:29 +0930

but the sender seems to have never got an answer to his mail...

Thank you im voraus


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

View raw message