lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joel Halbert <>
Subject Pattern for maintaining FSDirectory copy of RAMDirectory
Date Mon, 16 Feb 2009 15:49:31 GMT

I have a RAMDirectory based index. The document source for the index is
a database table, where content to be indexed is stored alongside a
status (pending_index, indexed, pending_delete, deleted). Each time the
application is started, and periodically thereafter, all documents from
the database that are "pending_index" or "indexed" are loaded and added
to the index. Once this is done their status is updated to
"indexed" (and this process repeats itself as required).

I would now like to keep a FSDir copy of the index, to speedup the
application start time. I am proposing to simply update both the FSDir
and RAMDir in tandem i.e. whenever a document is to be added to the
index, both Dirs are updated in one "transaction" (and the database
record is then updated to "indexed"). Then when the application is
restarted we know that all database records with a status of "indexed"
exist in the FSDir. This means I can load the FSDir into the InMem dir,
then update both with any outstanding database records which are

Can anyone see any issues with the above system? Is there anything I
should be aware of when maintaining a RAMDir in parallel to a FSDir?


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

View raw message