Hi Andy, From the API docs for IndexWriter <http://lucene.apache.org/java/3_0_2/api/all/org/apache/lucene/index/IndexWriter.html>:
[D]ocuments are added with addDocument and removed with deleteDocuments(Term) or deleteDocuments(Query). A document can be updated with updateDocument (which just deletes and then adds the entire document). When finished adding, deleting and updating documents, close should be called. These changes .... are not visible to IndexReader until either commit() or close() is called. So you gotta call commit() or close(). Once you've done that, you can reduce the (expensive) cost of opening a new IndexReader by calling reopen(): <http://lucene.apache.org/java/3_0_2/api/all/org/apache/lucene/index/IndexReader.html#reopen%28%29> Steve > -----Original Message----- > From: andynuss [mailto:andrew_n...@yahoo.com] > Sent: Monday, June 21, 2010 11:02 AM > To: java-user@lucene.apache.org > Subject: search hits not returned until I stop and restart application > > > Hi, > > I have an IndexWriter singleton in my program, and an IndexSearcher > singleton based on a readonly IndexReader singleton. When I use the > IndexWriter to index a large document to lucene, and then, while the > program is still running, use my previously created IndexSearcher to find > hits in that book, they are not found. But if I stop and restart the > application, then they are found. > > Andy > -- > View this message in context: http://lucene.472066.n3.nabble.com/search- > hits-not-returned-until-I-stop-and-restart-application- > tp911711p911711.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org