lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paolo Castagna <castagna.li...@googlemail.com>
Subject Is it possible to have Lucene and Solr (or two Solr instances) pointing at the same index directory?
Date Wed, 07 Apr 2010 16:00:44 GMT
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

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message