How to get status of _delete_by_query api in elasticsearch using scala

前端 未结 1 1871
星月不相逢
星月不相逢 2021-01-27 23:42

I am doing an HTTP post to elasticsearch in scala.

 Http(s\"http://$elkIp:5051/$indexName/_delete_by_query\")
          .postData(s\"\"\"{   \"query\": { \"term         


        
相关标签:
1条回答
  • 2021-01-28 00:33

    What you need to do is to add ?wait_for_completion=false to your request and you'll get the <task_id> in the response immediately.

    You can then regularly check the task status by hitting /_tasks/<task_id>. As soon as completed: true returns, then you know the task has finished executing.

    You need to also make sure to delete .tasks/task/<task_id> when your job is done otherwise it will stay in the task index.

    0 讨论(0)
提交回复
热议问题