lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benson Margulies" <bim2...@basistech.com>
Subject RE: isCurrent says no, but contents still invisible
Date Wed, 10 Jan 2007 23:42:33 GMT
If all is well with the lifecycle, should IndexReader.numDocs() return
an accurate count?



-----Original Message-----
From: Doron Cohen [mailto:DORONC@il.ibm.com] 
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" <bim2006@basistech.com> 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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message