java软件esclip_ES的JAVA客户端支持version乐观锁吗?

ES的JAVA客户端7.6版本现在支持version乐观锁吗查了很多资料,java客户端现在如果不支持version的乐观锁,现在最新版本如何使用乐观锁/p>

我使用了如下代码进行version版本控制:

“`java

IndexRequest indexRequest =

new IndexRequest(indexName)

.id(id)

.source(json, XContentType.JSON)

.opType(opType).version(version == null Versions.MATCH_ANY : version);

return client().index(indexRequest, RequestOptions.DEFAULT);

“`

使用 postman 测试给出以下响应:

“`java

{

“error”: {

“root_cause”: [

{

“type”: “action_request_validation_exception”,

“reason”: “Validation Failed: 1: internal versioning can not be used for optimistic concurrency control. Please use `if_seq_no` and `if_primary_term` instead;”

}

],

“type”: “action_request_validation_exception”,

“reason”: “Validation Failed: 1: internal versioning can not be used for optimistic concurrency control. Please use `if_seq_no` and `if_primary_term` instead;”

},

“status”: 400

}

“`

文章知识点与官方知识档案匹配,可进一步学习相关知识Java技能树首页概览91390 人正在系统学习中 相关资源:基于C程序的周易占卜软件_c语言算命系统-C#代码类资源-CSDN文库

来源:卜仆

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年1月23日
下一篇 2021年1月23日

相关推荐