diff --git a/config/alfresco/subsystems/Search/solr/solr-backup-context.xml b/config/alfresco/subsystems/Search/solr/solr-backup-context.xml
index 7e031d0927..2c4259b85a 100644
--- a/config/alfresco/subsystems/Search/solr/solr-backup-context.xml
+++ b/config/alfresco/subsystems/Search/solr/solr-backup-context.xml
@@ -49,6 +49,9 @@
+
+
+
@@ -98,6 +101,9 @@
+
+
+
\ No newline at end of file
diff --git a/config/alfresco/subsystems/Search/solr4/solr-backup-context.xml b/config/alfresco/subsystems/Search/solr4/solr-backup-context.xml
index e15522e030..652cfe0077 100644
--- a/config/alfresco/subsystems/Search/solr4/solr-backup-context.xml
+++ b/config/alfresco/subsystems/Search/solr4/solr-backup-context.xml
@@ -52,6 +52,9 @@
true
+
+
+
@@ -104,6 +107,9 @@
true
+
+
+
\ No newline at end of file
diff --git a/source/java/org/alfresco/repo/search/impl/solr/SolrBackupClient.java b/source/java/org/alfresco/repo/search/impl/solr/SolrBackupClient.java
index 2ca30100bf..ea138f95b7 100644
--- a/source/java/org/alfresco/repo/search/impl/solr/SolrBackupClient.java
+++ b/source/java/org/alfresco/repo/search/impl/solr/SolrBackupClient.java
@@ -55,8 +55,8 @@ public class SolrBackupClient implements InitializingBean
private boolean fixNumberToKeepOffByOneError = false;
private SOLRAdminClient solrAdminClient;
-
+ private SolrQueryHTTPClient solrQueryHTTPClient;
/**
@@ -87,6 +87,11 @@ public class SolrBackupClient implements InitializingBean
this.remoteBackupLocation = remoteBackupLocation;
}
+ public void setSolrQueryHTTPClient(SolrQueryHTTPClient solrQueryHTTPClient)
+ {
+ this.solrQueryHTTPClient = solrQueryHTTPClient;
+ }
+
/**
* @param numberToKeep the numberToKeep to set
*/
@@ -97,6 +102,10 @@ public class SolrBackupClient implements InitializingBean
public void execute()
{
+ if(solrQueryHTTPClient.isSharded())
+ {
+ return;
+ }
String lockToken = getLock(60000);
if (lockToken == null)
diff --git a/source/java/org/alfresco/repo/search/impl/solr/SolrQueryHTTPClient.java b/source/java/org/alfresco/repo/search/impl/solr/SolrQueryHTTPClient.java
index 2aef3e8fab..13b3491daf 100644
--- a/source/java/org/alfresco/repo/search/impl/solr/SolrQueryHTTPClient.java
+++ b/source/java/org/alfresco/repo/search/impl/solr/SolrQueryHTTPClient.java
@@ -36,6 +36,7 @@ import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.opencmis.dictionary.CMISStrictDictionaryService;
import org.alfresco.repo.admin.RepositoryState;
import org.alfresco.repo.domain.node.NodeDAO;
+import org.alfresco.repo.index.shard.Floc;
import org.alfresco.repo.index.shard.ShardInstance;
import org.alfresco.repo.index.shard.ShardRegistry;
import org.alfresco.repo.search.impl.lucene.JSONResult;
@@ -931,4 +932,35 @@ public class SolrQueryHTTPClient implements BeanFactoryAware, InitializingBean
throw new LuceneQueryParserException("", e);
}
}
+
+ /**
+ * @return
+ */
+ public boolean isSharded()
+ {
+ if((shardRegistry != null) && useDynamicShardRegistration)
+ {
+ for( Floc floc : shardRegistry.getFlocs().keySet())
+ {
+ if(floc.getNumberOfShards() > 1)
+ {
+ return true;
+ }
+ }
+ return false;
+
+ }
+ else
+ {
+ for(SolrStoreMappingWrapper mapping : mappingLookup.values())
+ {
+ if(mapping.isSharded())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ }
}