def __init__(self, index_name, batch_size=500):
        self.index_name = index_name
        self.buffer = []
        self.batch_size = batch_size
        self.total_size = 0
        self.connected = False
        self.client = None