On Tue, 20 Feb 2007 10:36:55 +0100, "jm" <[EMAIL PROTECTED]> 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
LockFactory.

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);
  lf.setLockPrefix(null);

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!).

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to