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

Wrong documents in results

2013-08-16 Thread Maksym Krasovskiy
Hi! I have documents with two fields id and name. I create index with code: Document doc = new Document(); doc.add(new TextField("id", id), Store.YES)); doc.add(new TextField("name", QueryParser.escape(name), Store.YES)); indexWriter.addDocument(doc); When I try to search with query with code: Que