lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "miki sun" <sun_m...@hotmail.com>
Subject doc.get("contents")
Date Thu, 06 Apr 2006 20:19:24 GMT
Dear all

I got a java.lang.NullPointerException at 
java.io.StringReader.<init>(StringReader.java:33) error when processing the 
following code:

for (int i = 0; i < theHits.length(); i++)
{
Document doc = theHits.doc(i);
String contents = doc.get("contents") ;
TokenStream tokenStream = analyzer.tokenStream( "contents", new 
StringReader(contents)) ;
System.out.println(theHighlighter.getBestFragment(tokenStream, contents));
}

I used demo.IndexFiles to index my directory. Who can tell me what's wrong? 
Thanks a lot!

Miki



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


Mime
View raw message