If all is well with the lifecycle, should IndexReader.numDocs() return an accurate count?
-----Original Message----- From: Doron Cohen [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 10, 2007 5:54 PM To: java-user@lucene.apache.org Subject: RE: isCurrent says no, but contents still invisible "Benson Margulies" <[EMAIL PROTECTED]> wrote on 10/01/2007 14:26:42: > Oh, boy, what a mistake. I thought I was being clever by creating a > Directory object. All that did was prevent the writer from ever quite > flushing because I wasn't closing THAT. > No need to close the directory object for that. Closing the IndexWriter will do. I think you will find "Lucene In Action" book very useful in understanding the life-cycle of an index. Or you may want to start with the javadocs intro at http://lucene.apache.org/java/docs/api (see the bottom of that page) and explore the API from there. In particular: http://lucene.apache.org/java/docs/api/org/apache/lucene/index/IndexWrit er.html#addDocument(org.apache.lucene.document.Document) http://lucene.apache.org/java/docs/api/org/apache/lucene/index/IndexWrit er.html#close() Also relevant are FAQ entries: http://wiki.apache.org/jakarta-lucene/LuceneFAQ#head-6c56b0449d114826586 940dcc6fe51582676a36e (concurrency) http://wiki.apache.org/jakarta-lucene/LuceneFAQ#head-3558e5121806fb4fce8 0fc022d889484a9248b71 (why-no-hits) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]