Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Invalid
-
5.4
-
None
-
None
-
Windows 8, Java 1.8.0_60
-
New
Description
I try to create a simple index and then update documents (with IndexWriter.updateDocuments). When I use RAMDirectory it works fine (IndexWriter.numDocs returns correct value, IndexSearcher.search returns correct hits). However, when I use FSDirectory it creates duplicate documents, and IndexSearcher returns multiple documents with same key field values. Here is the code excerpt:
//This code is in a thread and it updates documents with regular intervals, say 1 min.
Analyzer analyzer = new StandardAnalyzer();
try
iwriter.flush();
iwriter.commit();
System.out.println("Document count2=" + iwriter.numDocs());
iwriter.close();
} catch (IOException e1)