"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/IndexWriter.html#addDocument(org.apache.lucene.document.Document)
http://lucene.apache.org/java/docs/api/org/apache/lucene/index/IndexWriter.html#close()

Also relevant are FAQ entries:
http://wiki.apache.org/jakarta-lucene/LuceneFAQ#head-6c56b0449d114826586940dcc6fe51582676a36e
  (concurrency)
http://wiki.apache.org/jakarta-lucene/LuceneFAQ#head-3558e5121806fb4fce80fc022d889484a9248b71
  (why-no-hits)




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to