Re: Using Solr with an existing Lucene index

2009-01-15 Thread Chris Hostetter

: My first attempt to do this resulted in my Java program throwing a
: CorruptIndex exception. It appears as though Solr has somehow modified my
: index files in some way which causes the Lucene code to see them as corrupt
: (even though I did not, at least intentionally, try to post any documents or
: otherwise update the index through Lucene).

knowing the specifics of the exception would be helpful ... for example, 
if the exception message was "unknown format version: -X" that typically 
just means it was last touched by a newer version of Lucene then the 
one you are trying to read it with ... if hte version of lucene in solr is 
newer then then one you are using i can easily imagine this happening just 
from solr opening and closing an IndexWriter even if you never use Solr to 
add/commit any docs.

: If so, how? Is is just a matter of changing your data directory to your
: existing index data in the solrconfig.xml, for example:
:   /my/existing/lucene/index/data ?

solr expects the index to be named "index" inside the data directory -- 
but beyond that you also need to make sure your schema.xml is compatible 
(as mentioned in another thread i just replied to)



-Hoss



Re: Using Solr with an existing Lucene index

2009-01-07 Thread The Flight Captain

My first attempt to do this resulted in my Java program throwing a
CorruptIndex exception. It appears as though Solr has somehow modified my
index files in some way which causes the Lucene code to see them as corrupt
(even though I did not, at least intentionally, try to post any documents or
otherwise update the index through Lucene).

Did you manage to retrieve any data from your existing datasource through
Solr using the existing index?

If so, how? Is is just a matter of changing your data directory to your
existing index data in the solrconfig.xml, for example:
  /my/existing/lucene/index/data ?
-- 
View this message in context: 
http://www.nabble.com/Using-Solr-with-an-existing-Lucene-index-tp20002395p21344616.html
Sent from the Solr - User mailing list archive at Nabble.com.



Re: Using Solr with an existing Lucene index

2008-10-21 Thread Chris Hostetter

: I want to use Solr to provide a web-based read-only view of this index. 
: I require that the index not be locked in any way while Solr is using it 
: (so the Java program can continue updating it) and that Solr is able to 
: see new documents added to the index, if not immediately, at least a 
: couple of times a day.

This should be possible.  It's essentially what happens on a 'slave" 
instance of SOlr where replication updates the index.  you notify solr 
with a "commit" to tell it to open the new index after you've made changes 
with your existing application.

: My first attempt to do this resulted in my Java program throwing a 
: CorruptIndex exception. It appears as though Solr has somehow modified 

I'm not sure why this might have happened if you didn't attempt any 
updates with Solr, but one thing to check is if you are using 
single in your solrconfig.xml?  

that would make solr use an in memory lock file and it wouldn't notice 
your application already had a lock for updating the index if it did try 
to make a change.  You'll want to use simple (and 
make sure your app doesn't override the location of the lock file -- it 
needs to use the default lock file name in the index directory)



-Hoss



Using Solr with an existing Lucene index

2008-10-15 Thread Frank LaRosa
Hi,

I have a Java program which maintains a Lucene index using the Lucene Java APIs.

I want to use Solr to provide a web-based read-only view of this index. I 
require that the index not be locked in any way while Solr is using it (so the 
Java program can continue updating it) and that Solr is able to see new 
documents added to the index, if not immediately, at least a couple of times a 
day.

My first attempt to do this resulted in my Java program throwing a CorruptIndex 
exception. It appears as though Solr has somehow modified my index files in 
some way which causes the Lucene code to see them as corrupt (even though I did 
not, at least intentionally, try to post any documents or otherwise update the 
index through Lucene).

Please let me know if what I want is even possible with this software. If so, 
what config options should I be looking at? I couldn't find anything that 
suggested a read-only index.

Thanks,

Frank