lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luc...@nitwit.de
Subject Re: Did you mean...
Date Mon, 16 Feb 2004 14:50:37 GMT
On Monday 16 February 2004 12:12, lucene@nitwit.de wrote:
> deprecated:
>
> String description = doc.getField("contents").stringValue();
> final java.io.Reader r = new StringReader(description);
> final TokenStream in = analyzer.tokenStream(r);
> for (Token token; (token = in.next()) != null; )
> {
> 	System.out.println(token.termText());
> }

Can somebody explain tokenStream() to me?

This is not deprecated:

TokenStream in = new WhitespaceAnalyzer().tokenStream("contents", new 
StringReader(doc.getField("contents").stringValue()));

But what is the first argument (field) for tokenStream() good for? Actually I 
can type whatever I want...? Don't understand the short description in the 
API docs...

Timo

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message