For Elastic Search version 6.0
to cancel a running task:
POST _tasks/node_id:task_id/_cancel
I am following the same statement, but in actual it is unable to cancel the task. After running this command if I run get command to fetch all running task, the particular task don't get cancel.
If I hit cancel statement again, it gives statement that task_id is already cancelled but in reality it doesn't get cancel.