diff --git a/KeywordSearch/solr/server/solr/configsets/AutopsyConfig/conf/schema.xml b/KeywordSearch/solr/server/solr/configsets/AutopsyConfig/conf/schema.xml
index d29343fe22..3bebad7be7 100755
--- a/KeywordSearch/solr/server/solr/configsets/AutopsyConfig/conf/schema.xml
+++ b/KeywordSearch/solr/server/solr/configsets/AutopsyConfig/conf/schema.xml
@@ -229,7 +229,7 @@
@@ -237,7 +237,7 @@
-
+
@@ -263,7 +263,7 @@
-
+
-
+
diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java
index 26396164db..b7d9d42f6a 100644
--- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java
+++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java
@@ -1141,7 +1141,31 @@ public class Server {
// shard across all available servers
return solrServerList.size();
}
-
+
+ /*
+ * Poll the remote Solr server for list of existing collections, and check if
+ * the collection of interest exists.
+ *
+ * @param collectionName The name of the collection.
+ *
+ * @return True if the collection exists, false otherwise.
+ *
+ * @throws SolrServerException If there is a problem communicating with the
+ * Solr server.
+ * @throws IOException If there is a problem communicating with the Solr
+ * server.
+ */
+ private boolean collectionExists(String collectionName) throws SolrServerException, IOException {
+ CollectionAdminRequest.List req = new CollectionAdminRequest.List();
+ CollectionAdminResponse response = req.process(remoteSolrServer);
+ List existingCollections = (List) response.getResponse().get("collections");
+ if (existingCollections == null) {
+ existingCollections = new ArrayList<>();
+ }
+ return existingCollections.contains(collectionName);
+ }
+
+ /* NOTE: Keeping this code for reference, since it works.
private boolean collectionExists(String collectionName) throws SolrServerException, IOException {
// TODO we could potentially use this API. Currently set exception "Solr instance is not running in SolrCloud mode"
@@ -1174,7 +1198,7 @@ public class Server {
} else {
return false;
}
- }
+ }*/
private void createMultiUserCollection(String collectionName, int numShardsToUse) throws KeywordSearchModuleException, SolrServerException, IOException {
/*