Cannot clear refresh_interval of Index Setting with null using low level client
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with the Time.Builder and PutIndicesSettingsRequest usage shown in the issue, then trace how a null refresh interval is serialized by the low-level client. Compare this with the High Level Client request and determine whether clearing the setting is supported; done means the behavior is fixed or clearly documented and covered by a regression test.
Written by the indexing model from the issue text.
Description
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?
- Dominant language
- Java
- Stars
- 524
- Forks
- 299
- Avg merge
- 16m
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from elastic/elasticsearch-java
-
Delete By Query deserialization will not account for search failuresPossibly taken @l-trotta claimed this today. Open
elastic/elasticsearch-java#1349 · 1 assignee ·
Maintainers usually reply within 1 day
-
Nested index settings that do not end up deserialized in otherSettings leads to requiring properties on parent JSON nodesPossibly taken @l-trotta claimed this today. OpenArea: Specification Category: Bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
elastic/elasticsearch-java#1347 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
RestClientTransport sends bulk bodies as one HTTP chunk / TLS record / syscall per NDJSON buffer, burning ~45x the reactor CPU of the HLRCPossibly taken @l-trotta claimed this 16 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 72/100
elastic/elasticsearch-java#1339 · 5 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
elastic/elasticsearch-java#1212 · 8 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
elastic/elasticsearch-java#1165 · 5 comments ·
Maintainers usually reply within 1 day
All issues in elastic/elasticsearch-java
Similar issues
-
Update license yearOpen0 - Backlog 1 - Ready documentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
cbor
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
FasterXML/jackson-dataformats-binary#844 ·
Maintainers usually reply within 1 day
-
Issue: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OpenAPITools/openapi-generator#25107 ·
Maintainers usually reply within 1 day
-
improvement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/iceberg#18351 · 1 comment ·
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
repowise-dev/repowise#2945 · 1 comment ·
Maintainers usually reply within 1 day