def _index_docs(self,numDocs,coll):
        self.docs = self.rand_docs.get_docs(numDocs)
        sdate = datetime.datetime.now() - datetime.timedelta(days=180)
        edate = datetime.datetime.now() + datetime.timedelta(days=30)
        self._start_date = sdate
        self._end_date = edate
        
        import random
        #Assign random times to documents that are generated. This is used to spread out the documents over multiple time ranges
        hours = (edate-sdate).days * 24
        hour_range = [x for x in range(int(hours))]
        self.date_counts = {}

        #Save the newest and oldest timestamps as well as assign them to first and second doc
        self.docs[0]['date'] = sdate.isoformat()+'Z'
        self.date_counts[sdate.date().isoformat()] = 1

        self.docs[1]['date'] = edate.isoformat()+'Z'
        self.date_counts[edate.date().isoformat()] = 1

        for doc in self.docs[2:]:
            #Make a new date and store a count of it so I can compare later
            new_date = (sdate+datetime.timedelta(hours=random.choice(hour_range)))
            new_date_s = new_date.date().isoformat()
            if new_date_s in self.date_counts:
                self.date_counts[new_date_s] += 1
            else:
                self.date_counts[new_date_s] = 1
            doc['date'] = new_date.isoformat()+'Z'

        self.solr.index_json(coll, json.dumps(self.docs))
        self.solr.commit(coll, openSearcher=True)
        time.sleep(10)
Generates and indexes in random data while maintaining counts of items in various date ranges.
dataset/ETHPy150Open moonlitesolutions/SolrClient/test/test_reindexer.py/ReindexerTests._index_docs