Re: Lucene 4.0 WhitespaceAnalyzer problem

2013-01-15 Thread Alon Muchnick
hi Maxim , you need to reset the tokenStream before the while loop - tokenStream .reset () check out http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/analysis/package-summary.html look under "invoking the analyzer" : "ts.reset(); // Resets this stream to the beginning. (Required)"

Lucene 4.0 WhitespaceAnalyzer problem

2013-01-15 Thread Maksym Krasovskiy
Hi! I try to use WhitespaceAnalyzer from Lucene 4.0 for splitting strings to words. I wrote smal test: @Test public void whitespaceAnalyzerTest() throws IOException { String string = "sdfdsf sdfsdf sd sdf "; Analyzer wa = new WhitespaceAnalyzer(Version.LUCENE_40); TokenStream tokenStre