Cannot clear refresh_interval of Index Setting with null using low level client
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
调研方向
先从 issue 中所示的 Time.Builder 和 PutIndicesSettingsRequest 用法开始,然后跟踪 low-level client 如何序列化 null refresh interval。将其与 High Level Client 的请求进行比较,并确定是否支持清除设置;当行为得到修复,或已有明确文档说明并由回归测试覆盖时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Java API client version
7.17.1
Java version
8
Elasticsearch Version
7.17.1
Problem description
Using the rest High Level Client, I was able to overwrite the refresh_interval value of an indexSetting to be the default value using the following bit of code:
UpdateSettingsRequest updateSettingsRequest = new UpdateSettingsRequest("accounts-index");
updateSettingsRequest.settings(Settings.builder().put("index.refresh_interval", (String) null));
try {
restHighLevelClient.indices().putSettings(updateSettingsRequest, RequestOptions.DEFAULT);
}
catch(IOException e) {
throw new Exception();
}
Using the low level client, I am unable to do so. If I try to run the following bit of code:
IndexSettings indexSettings = IndexSettings.of(is -> is
.refreshInterval(Time.of(t -> t.time((String) null))));
PutIndicesSettingsRequest putIndicesSettingsRequest = PutIndicesSettingsRequest.of(pisr -> pisr
.index(singleton("accounts-index"))
.settings(indexSettings));
try {
PutIndicesSettingsResponse putIndicesSettingsResponse = esClient.indices()..putSettings(putIndicesSettingsRequest);
return putIndicesSettingsResponse.acknowledged();
}
catch (IOException e) {
throw new Exception(e);
}
I get the exception:
co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'Builder.<variant value>'
at co.elastic.clients.util.ApiTypeHelper.requireNonNull(ApiTypeHelper.java:76)
at co.elastic.clients.elasticsearch._types.Time.<init>(Time.java:97)
at co.elastic.clients.elasticsearch._types.Time.<init>(Time.java:57)
at co.elastic.clients.elasticsearch._types.Time$Builder.build(Time.java:176)
at co.elastic.clients.elasticsearch._types.Time$Builder.build(Time.java:158)
at co.elastic.clients.elasticsearch._types.Time.of(Time.java:102)
For now, I have reverted to setting the refresh_interval explicitly to 1 second when I want to set it to the default. I want to however switch back to being able to overwrite the refresh_interval to just be the default without explicitly setting it, ie. by passing null instead of "1s" to the Time parameter.
Is there a way to do this I am missing or is this a bug in the Time object that does not allow passing of null?
- 主要语言
- Java
- 星标
- 525
- 派生
- 299
- 平均合并
- 13 小时 9 分钟
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
elastic/elasticsearch-java 的其他 Issue
-
Transport options set on the client builder drop SafeResponseConsumer可能已有人在做 @RaphaelFakhri 今天认领。 未关闭
难度 3/5 1-2 天 新手友好度 54/100
elastic/elasticsearch-java#1354 ·
-
`rebuild()` of bulk operations (`IndexOperation`, `CreateOperation`, `UpdateOperation`) drops most fields可能已有人在做 @l-trotta 于 4 天前认领。 未关闭Area: Generator Category: Bug
难度 3/5 1-2 天 新手友好度 50/100
elastic/elasticsearch-java#1353 · 1 条评论 · 已指派 1 人 ·
-
Delete By Query deserialization will not account for search failures可能已有人在做 @l-trotta 于 17 天前认领。 未关闭
elastic/elasticsearch-java#1349 · 1 条评论 · 已指派 1 人 ·
-
Nested index settings that do not end up deserialized in otherSettings leads to requiring properties on parent JSON nodes可能已有人在做 @l-trotta 于 17 天前认领。 未关闭Area: Specification Category: Bug
难度 4/5 3-5 天 新手友好度 48/100
elastic/elasticsearch-java#1347 · 1 条评论 · 已指派 1 人 ·
-
RestClientTransport sends bulk bodies as one HTTP chunk / TLS record / syscall per NDJSON buffer, burning ~45x the reactor CPU of the HLRC可能重新可做 @l-trotta 于 33 天前认领,目前没有进行中的 PR。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
elastic/elasticsearch-java#1339 · 5 条评论 · 已指派 1 人 ·
查看 elastic/elasticsearch-java 的全部 Issue
相似的 Issue
-
[Bug] dubbo.protocol.triple.max-message-size is only read from OS environment variables可能已有人在做 @CCCLL 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
hierynomus/sshj#1070 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
intellij-elixir/intellij-elixir#4492 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 77/100
-
难度 2/5 1-3 小时 新手友好度 76/100
quarkiverse/quarkus-openapi-generator#1796 · 1 条评论 ·