lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless" <>
Subject Re: 2.1 lock file name
Date Tue, 20 Feb 2007 11:32:49 GMT

On Tue, 20 Feb 2007 10:36:55 +0100, "jm" <> said:

> I updated my code to use 2.1 (IndexWriter deleting docs etc), and when
> using native locks I still get a lock like this:
> lucene-2361bf484af61abc81e6e7f412ad43af-n-write.lock
> and when using SimpleFSLockFactory:
> lucene-2361bf484af61abc81e6e7f412ad43af-write.lock

The defaulting only happens if FSDirectory.getDirectory() is called
without passing your own LockFactory.

If instead you create your own LockFactory and pass that in, then
FSDirectory won't change whichever lockDir you had specified to that

If you want this same default behavior, but from your own created
LockFactory, you can do something like this:

  LockFactory lf = new NativeFSLockFactory(indexDir);
  Directory d = FSDirectory.getDirectory(indexDir, lf);

That last line tells the lock factory that it's not necessary to use
that large digest prefix to differentiate locks (assuming
no other writer will be storing locks in this directory!).


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

View raw message