lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless" <>
Subject Re: How to use "point-in-time" feature
Date Tue, 10 Jul 2007 11:16:55 GMT
In your application, can more than one machine be the writer?  If so,
there is at least one known active issue
( in Lucene 2.2 that
prevents this from working.

If instead the writer is always on a single machine, then it should
work, though please note that this area is not heavily tested yet!
Please report back if you move forward on this so we can gather data

The thing you have to do is create a custom deletion policy, which is
just a class implementing this interface:

You will need to implement your own application-dependent logic here
to tell the writer when it is safe to remove old commits.  For example
if you know all of your readers will check once per hour and re-init
themselves if the index has changed, then you would make a deletion
policy that removes any commits older than 1 hour.

The unit test for deletion policies (in the source distribution for
2.2) has several example deletion policies including one called
"ExpirationTimeDeletionPolicy" which implements the example above.

Once you've implemented such a class, then every time you open the
writer you must pass in an instance of your class and this will
prevent the writer from removing commit points (and the segments they
reference) that might be in use by your readers on other machines.

You can see gory details on current known status of Lucene over NFS


"anson" <> wrote:
> Hi,
> I saw the new feature "point-in-time" on Lucene2.2.
> If I upgrade my web-app from Lucene2.0 to Lucene2.2, I want to do that 
> my web-app can access the INDEX over NFS , so what should I do to change 
> my old web-app.
> Could anyone show me some samples or your opinions.
> (i.e. what difference on making index, searching between Lucene2.0 and 
> Lucene2.2)
> Best regards
> Anson
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message