ElasticSearch updates are not immediate, how do you wait for ElasticSearch to finish updating it's index?

前端 未结 4 456
耶瑟儿~
耶瑟儿~ 2020-12-16 11:13

I\'m attempting to improve performance on a suite that tests against ElasticSearch.

The tests take a long time because Elasticsearch does not update it\'s indexes i

4条回答
  •  佛祖请我去吃肉
    2020-12-16 11:46

    If you use bulk helpers you can do it like this:

    from elasticsearch.helpers import bulk    
    bulk(client=self.es, actions=data, refresh='wait_for')
    

提交回复
热议问题