java-user@lucene.apache.org
[Top] [All Lists]

Re: The best way to know when an index has been changed

Subject: Re: The best way to know when an index has been changed
From: Stanislav Jordanov
Date: Wed, 03 Aug 2005 17:39:25 +0300
Hi Steve,

we have a similar situation and we choosed the following solution:
The process that modifies the index (the writer) notifies the process that searches the index (the reader) In our case the notification is a specificly named subdirectory "index_modified" of the directory containing the index files. After each update to the index (or if it turns out to slow down the indexing process - make it not not more than once a minute) the writer process raises the flag by creating the directory if it does not exists. On the other hand the reader removes the directory each time it recreates its Searcher.
Does this approach suit your needs?

Regards:
Stanislav

Steve Gaunt wrote:

Hi Luke

It's a good idea, but we need to know instantly the fail over happens.
We obtain a new instance of the index searcher every night anyway to
obtain the latest index.  When the fail over happens, the index location
is in the same place, but was wandering if there was a way to find out
if the index has changed without the database hit the first search hits
lucene after the failover.

Hope this explains the scenario more clearly.

Steve



-----Original Message-----
From: Luke [mailto:luke@xxxxxxxxxxxxxxx] Sent: 03 August 2005 14:47
To: java-user@xxxxxxxxxxxxxxxxx
Subject: Re: The best way to know when an index has been changed

Hi Steve;

Not sure if this would work...

Each day you could get the value from IndexReader's  getCurrentVersion
and
store it somewhere (DB or serialize it). The next day when you grab the
value again you could compare it to the stored one, if they differ you
would
know it has been replaced.

Luke

----- Original Message ----- From: "Steve Gaunt" <SGaunt@xxxxxxxxxxxxxxxxxx>
To: <java-user@xxxxxxxxxxxxxxxxx>
Sent: Wednesday, August 03, 2005 9:34 AM
Subject: The best way to know when an index has been changed


Hi

We have a web app, which keep a copy of the index searcher, then
reloads
the index searcher every night to obtain the latest version of the
index( as it updates every day).
However, we have a fail over mode, which will eventually use another
index on another server, it there anyway to know if the underlying
index
has been replaced with another index???


Cheers in advance

Steve


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: java-user-help@xxxxxxxxxxxxxxxxx





---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: java-user-help@xxxxxxxxxxxxxxxxx


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: java-user-help@xxxxxxxxxxxxxxxxx




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: java-user-help@xxxxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>