0

We update our customers' Solr version periodically. We created a shared core called remote_shared_instance in Solr. Some customers use this and others don't. The customers who don't use the core are seeing error message about the remote_shared_instance

org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Error opening new searcher

The error message is displayed because these customers often didn't rebuild the index, which was created with an old Solr version (3 or less). The current Solr (5.5.5) can't handle this index.

I am using Perl, and I want to create a program which will check whether the remote_shared_instance index is empty. If so, it will drop the core and restart Solr, which will automatically create a new index and the error message will disappear.

How can I make sure remote_shared_instance index is empty?

I printed the files in the 'index' folder from one customer who gets the error message:

-rw-rw---- 1 sfxglb41 sfx 32 Sep 10  2014 segments_1
-rw-rw---- 1 sfxglb41 sfx 20 Sep 10  2014 segments.gen
-rw-r----- 1 sfxglb41 sfx  0 Jun 13 04:42 write.lock

1 Answer 1

2

I'm guessing you want to do this without actually reading the index then?

If the index only has segments files (a segments.gen and one or more segments_N) and a write.lock, it's empty. An index with documents in it would have other files, (generally, an index with data will typically have at least one .cfs or .fdx file), which would contain the indexed data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.