Hi, IndexReaders, on which you are doing the search, are a snapshot of the index at the time it was opened. Later commits by IndexWriter are not seen unless you reopen the IndexReader. This can be done with IndexReader.openIfChanged() (since Lucene 3.5) or IndexReader.reopen() (before 3.5).
Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: Cheng [mailto:zhoucheng2...@gmail.com] > Sent: Thursday, December 29, 2011 5:27 PM > To: java-user@lucene.apache.org > Subject: Can't get a hit > > Hi, > > I need to save a list of records into an index on hard drive. I keep a writer and a > reader open till the end of the operation. > > My issue is that I need to compare each of the new records with each of the > records that have been saved into the index. There are plenty of duplicate > records in the original list. > > To my surprise, I can't find a hit for a duplicate record on the fly although I use > the writer.commit() for every record that were being saved. > > However, if I intentionally stopped the operations (some of the records being > saved), I re-ran the list of records and lots of hits occurs. > > Please help! > > Thanks! --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org