We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6b2330 commit a49ba6eCopy full SHA for a49ba6e
document-apis/update-api.md
@@ -1,6 +1,5 @@
1
2
### Update API
3
-更新索引
4
5
有两种方式更新索引:
6
- 创建 `UpdateRequest`,通过client发送;
@@ -22,6 +21,8 @@ client.update(updateRequest).get();
22
21
23
#### 使用 `prepareUpdate()` 方法
24
+> 这里官方的示例有问题,new Script()参数错误,所以一下代码是我自己写的(2017年11月10日)
25
+
26
```
27
client.prepareUpdate("ttl", "doc", "1")
28
.setScript(new Script("ctx._source.gender = \"male\"" ,ScriptService.ScriptType.INLINE, null, null))//脚本可以是本地文件存储的,如果使用文件存储的脚本,需要设置 ScriptService.ScriptType.FILE
@@ -37,7 +38,7 @@ client.prepareUpdate("ttl", "doc", "1")
37
38
39
#### Update by script
40
-使用脚本更新文档
41
+使用脚本更新文档
42
43
44
UpdateRequest updateRequest = new UpdateRequest("ttl", "doc", "1")
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments