'Given a list of documents, uses Elasticsearch bulk indexing.
For each doc this calls `extract_document`, then indexes.
`chunk_size` defaults to the elasticsearch lib\'s default. Override per
your document size as needed.'

def bulk_index(self, data, index=None, chunk_size=500, parent=None, routing=None):

    index = (index or self._index)
    docs = []
    for d in data:
        source = self.extract_document(d)
        doc = {'_index': index, '_type': self._type, '_id': source['id'], '_source': source}
        if parent:
            doc['_parent'] = parent
        if routing:
            doc['_routing'] = routing
        docs.append(doc)
    bulk_index(self.es, docs, chunk_size=chunk_size)
