lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Rodriguez <crodrig...@gmail.com>
Subject Shouldnt IndexWriter.flushRamSegments() be public? or at least protected?
Date Tue, 28 Sep 2004 00:02:36 GMT
Hello,

I am trying to use transactions with the Lucene + BDB package. I want
to be able to open a directory, and IndexWriter and then do things
like:

open IndexWriter
start transaction 1
write something to the index
commit transaction 1 (or abort it)
start transaction 2
write something else to the index
commit transaction 2
etc...
close IndexWriter 
and everything else that needs to be closed

Now the problem I have is that I dont have a way to force a flush of
the IndexWriter without closing it and I need to do that before
commiting a transaction or I would get random errors. Shouldnt that
function be public, in case the user wants to force a flush at some
point that is not when the IndexWriter is closed? If not I am forced
to create a new IndexWriter and close it EVERY TIME I commit a
transaction (which in my application is very often).

I thought about creating a subclass of IndexWriter (something like
DbIndexWriter) that implements a flush function but everything I need
from IndexWriter is private (not even protected!) so I cant do this.

Any pointers or solutions to this problem? (Of course I would prefer
not to touch Lucene's code and make flushRamSegments() public myself,
since I dont want to break my code every time I update Lucene,
although I dont see why the user shouldnt be allow to flush segments
to the directory if they decide to... if it ruins the performance,
thats their call).

Thanks!
Xtian

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


Mime
View raw message