lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Satuluri, Venu_Madhav" <>
Subject RE: Keeping RAMDirectory and filesystem index in sync
Date Mon, 13 Mar 2006 14:06:59 GMT
Thanks, Jens. Seems like this would be pretty complicated. 

It seems the best way would be not have a separate daemon for indexing modifiied documents,
but just have the reindexing part in the backend itself (it would know when any documents
were modifiied), but since it would involve some code/design change, I thought I should first
find out if there was any way I could lessen the work.


-----Original Message-----
From: Jens Kraemer [] 
Sent: Monday, March 13, 2006 7:19 PM
Subject: Re: Keeping RAMDirectory and filesystem index in sync

On Mon, Mar 13, 2006 at 06:23:10PM +0530, Satuluri, Venu_Madhav wrote:
> Hi,
> Is there an elegant way to keep RAMDirectory and my file-system based
> index in sync? I have a java class that is periodically started up by
> crond that checks for modified documents and then reindexes them onto
> the filesystem. However, for searching I want to use RAMDirectory (for
> the performance benefits). The process that searches is alive all the
> time (its in the backend of a webapp), and is different from the process
> that indexes. 

You could somehow (HTTP, Database flag, some messaging system) ping your 
backend from your Indexing process, once it's finished. 
The Searching process then would have to re-open it's RAMDirectory. 

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 don't know of any more elegant ways.


webit! Gesellschaft für neue Medien mbH
Dipl.-Wirtschaftsingenieur Jens Krämer
Schnorrstraße 76                         Tel +49 351 46766  0
D-01069 Dresden                          Fax +49 351 46766 66

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

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

View raw message