mirror of https://github.com/apache/lucene.git
SOLR-5750: Fix test to specify the collection on add
This commit is contained in:
parent
382ffdb636
commit
18d933ee65
|
@ -121,7 +121,6 @@ public class TestCloudBackupRestore extends SolrCloudTestCase {
|
||||||
log.info("Indexing ZERO test docs");
|
log.info("Indexing ZERO test docs");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CloudSolrClient client = cluster.getSolrClient();
|
|
||||||
List<SolrInputDocument> docs = new ArrayList<>(numDocs);
|
List<SolrInputDocument> docs = new ArrayList<>(numDocs);
|
||||||
for (int i=0; i<numDocs; i++) {
|
for (int i=0; i<numDocs; i++) {
|
||||||
SolrInputDocument doc = new SolrInputDocument();
|
SolrInputDocument doc = new SolrInputDocument();
|
||||||
|
@ -129,7 +128,8 @@ public class TestCloudBackupRestore extends SolrCloudTestCase {
|
||||||
doc.addField("shard_s", "shard" + (1 + random.nextInt(NUM_SHARDS))); // for implicit router
|
doc.addField("shard_s", "shard" + (1 + random.nextInt(NUM_SHARDS))); // for implicit router
|
||||||
docs.add(doc);
|
docs.add(doc);
|
||||||
}
|
}
|
||||||
client.add(docs);// batch
|
CloudSolrClient client = cluster.getSolrClient();
|
||||||
|
client.add(collectionName, docs);// batch
|
||||||
client.commit(collectionName);
|
client.commit(collectionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue