Document APIs - Delete API

优质
小牛编辑
127浏览
2023-12-01

Delete API

根据ID删除:

  1. DeleteResponse response = client.prepareDelete("twitter", "tweet", "1").get();

更多请查看 delete API 文档

配置线程

operationThreaded 设置为 true 是在不同的线程里执行此次操作

下面的例子是operationThreaded 设置为 false

  1. GetResponse response = client.prepareGet("twitter", "tweet", "1")
  2. .setOperationThreaded(false)
  3. .get();
  1. DeleteResponse response = client.prepareDelete("twitter", "tweet", "1")
  2. .setOperationThreaded(false)
  3. .get();