lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <>
Subject RE: How to reflect index changes to search automatically
Date Fri, 13 Jul 2007 07:48:20 GMT
The SearchClient is obviously not aware of a changing index, so doesn't know when it has to
be reopened. 

You can at least do the following:

1) you periodically check for the index folder wether its timestamp did change (or if this
stays the same, do it with the files in it) --> if changed, reopen the ParallelMultiSearcher.
All you would need is some file monitor (filetimestamp validity cache)

2) you add eventListeners to the SearchServer, and implement something like jms (activeMQ
, openJMS) to send events to all listeners on an index update, which in turn invalidate their
ParallelMultiSearcher. (eventvalidity cache)

3) keep your searcher for X minutes, and then after x minnutes, reopen it (expires validity

obviously, number 2 is the nicest, though also the hardest

Regards Ard

> Hi,
>      I have SearchServer and SearchClient programs. The SearchServer
> using RemoteSearchable
> for binding the indices in servers . The SearchClient using
> ParallelMultiSearcher for searching the indices. The problem 
> is that I have
> to restart the search servers for reflecting the index change 
> in search on
> every index change(add or update). Is there any other 
> solution to reflect
> the changes in search. That is without restarting the SearchServer.
> Thanks,
> Sonu

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

View raw message