@classmethod
def create_batch(cls, nb_record, **kwargs):
    """Create n records in elastic, using bulk.

    nb_record: int
    """
    model_class = cls.Meta.model
    ids = []
    if hasattr(cls.Meta, 'max_bulk_size'):
        max_bulk_size = cls.Meta.max_bulk_size
    else:
        max_bulk_size = cls.MAX_BULK_SIZE
    bulk = ''
    if nb_record > max_bulk_size:
        nb_record = max_bulk_size
    for x in range(0, nb_record):
        bulk += model_class.bulk_data(cls.build(**kwargs))
    bulk_result = model_class.send(bulk)
    for one_record in bulk_result['items']:
        ids.append(one_record['index']['_id'])
    model_class.refresh()
    query = {'_source': '*', 'query': {'terms': {'_id': ids}}}
    return model_class.scan(query, limit=len(ids))
