How to get status of _delete_by_query api in elasticsearch using scala

前端 未结 1 1872
星月不相逢
星月不相逢 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 in the response immediately.

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

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

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