Hi,
(I know that this is probably not recommended and not a common
scenario, but...)

Is it possible to have an application using Lucene and a separate
(i.e. different JVM) instance of Solr both pointing at the same
index and read/write to the index from both applications?

I am trying (separately) two lockType settings in solrconfig.xml:
"native" and "simple" and the corresponding SimpleFSLockFactory
and NativeFSLockFactory with Lucene.

I have noticed that if I use:

  Directory dir = FSDirectory.open(
                    new File(path),
                    new SimpleFSLockFactory(path));

The lock file is called "writer.lock", while if I use:

  Directory dir = FSDirectory.open(new File(path));
  dir.setLockFactory(new SimpleFSLockFactory(path));

The lock file is called "lucene-{number}-writer.lock".

Solr uses the second method to set a custom lock factory.

Is the {number} supposed to be unique and the always same across
different JVMs?

I have also noticed that when Solr starts it creates a lock file even
if there are no updates or commits to the index. Why? Is this normal?

Finally, I would like to know if what I am doing is possible, what
are the potential problems and if people with more experience with
Lucene and Solr have suggestions on recommended settings or best
practices.

Thanks,
Paolo

Reply via email to