java-user@lucene.apache.org
[Top] [All Lists]

doc.get("contents")

Subject: doc.get"contents"
From: "miki sun"
Date: Thu, 06 Apr 2006 20:19:24 +0000
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@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: java-user-help@xxxxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>