lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Earwin Burrfoot <ear...@gmail.com>
Subject Re: Urgent! Forgot to close IndexWriter after adding Documents to the index.
Date Tue, 22 Mar 2011 09:14:23 GMT
On Tue, Mar 22, 2011 at 06:21, Chris Hostetter <hossman_lucene@fucit.org> wrote:
>
> (replying to the dev list, see context below)
>
> : Unfortunately, you can't easily recover from this (except by
> : reindexing your docs again).
> :
> : Failing to call IW.commit() or IW.close() means no segments file was written...
>
>
> I know there were good reasons for eliminating the "autoCommit"
> functionality from IndexWriter, but threads like tis make me thing thta
> even though "autoCommit" on flush/merge/whatever was bad, having an option
> for some sort of "autoClose" using a finalizer might by a good idea to
> give new/novice users a safety net.
>
> In the case of totally successful normal operation, this would result in
> one commit at GC (assuming the JVM calls the finalizer) and if there were
> any errors it should (if i understnad correclty) do an implicit rollback.
>
> Anyone see a downside?
Yes. Totally unexpected magical behaviour.
What if I didn't commit something on purporse?

>        ...
>
> : > I had a program running for 2 days to build an index for around 160 million
> : > text files, and after program ended, I tried searching the index and found
> : > the index was not correctly built, *indexReader.numDocs()* returns 0. I
> : > checked the index directory, it looked good, all the index data seemed to be
> : > there, the directory is 1.5 Gigabytes in size.
> : >
> : > I checked my code and found that I forgot to call *indexWriter.optimize()*and
> : > *indexWriter.close()*, I want to know if it is possible to
> : > *re-optimize()*the index so I don't need to rebuild the whole index
> : > from scratch? I don't
> : > really want the program to take another 2 days.
>
>
> -Hoss
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>



-- 
Kirill Zakharenko/Кирилл Захаренко
E-Mail/Jabber: earwin@gmail.com
Phone: +7 (495) 683-567-4
ICQ: 104465785

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


Mime
View raw message