lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Keeping RAMDirectory and filesystem index in sync
Date Mon, 13 Mar 2006 23:33:51 GMT

: The Searching process then would have to re-open it's RAMDirectory.

the key to all of this being that there are constructors for RAMDirectory
that make it very easy to load in the contents of an FSDirectory.

: Or you check the version of the fs-based index from time to time, to see
: when it has changed. Using IndexReader.getCurrentVersion (path_to_index)
: this shouldn't be too expensive. But there's the risk that you re-open
: your RAMDirectory in the middle of an index update, since the version
: changes on every single modification done to the index.

I'm not certain if you are correct that the version changes on every
modification -- but even if it does, opening an index will only get the
changes as of the last "commit".  As long as you throttle how frequently
you re-open your RAMDirectory with some minimum "int timeSinceLastOpen",
and how often you check the version with some "int sleepBetweenVersionChecks"
this approach should work fine.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message