title: Merging collections split across multiple shards
body: <hr>
  
  <p><strong>Brief overview of the setup:</strong> </p>
  
  <p>5 x SolrCloud (Solr 4.6.1) node instances (separate machines).<br>
  The setup is intended to store last 48 hours webapp logs (which are pretty intense... ~ 3MB/sec)</p>
  
  <p>"logs" collection has 5 shards (one per node instance).<br>
  One logline represents one document of "logs" collection </p>
  
  <hr>
  
  <p>If I keep storing log documents to this "logs" collection, cores on shards start getting really big and CPU graphs show that instances spend more and more time waiting for disk I/O. </p>
  
  <p>So, my idea is to create new collection with each 15 minutes and name it "logs-201402051400" with shards spread across 5 instances. Document writers will start writing to the new collection as soon as it is created. At some time I will get the list of collection like that: </p>
  
  <p>...<br>
  logs-201402051400<br>
  logs-201402051415<br>
  logs-201402051430<br>
  logs-201402051445<br>
  logs-201402051500<br>
  ...</p>
  
  <p>Since there will be max 192 collections (~1000 cores) in the SolrCloud at some certain period of time. It seems that search performance should degrade drastically.  </p>
  
  <p>So, I would like to merge collections that are not being currently written to into one large collection (but still sharded across 5 instances). I have found information how to merge cores, but how can I merge collections? </p>