Skip to content

VariableWidthHistogramAggregation is missing script field #457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tommy-th opened this issue Dec 1, 2022 · 1 comment · Fixed by #776
Closed

VariableWidthHistogramAggregation is missing script field #457

tommy-th opened this issue Dec 1, 2022 · 1 comment · Fixed by #776
Labels
Area: Specification Related to the API spec used to generate client code

Comments

@tommy-th
Copy link

tommy-th commented Dec 1, 2022

Java API client version

8.5.1

Java version

17

Elasticsearch Version

8.5.1

Problem description

VariableWidthHistogramAggregation is missing script field. I have alread checked ES support script field when we search histogram data like below.

GET test-index/_search
{
  "size": 0,
  "aggregations": {
    "factors": {
        "variable_width_histogram": {
            "field": "testField",
            "script": "Math.log10(_value)",
            "buckets": 100
        }
    }
  }
}

However, ES API client doesn't seem to support the script field yet.

protected static void setupVariableWidthHistogramAggregationDeserializer(
ObjectDeserializer<VariableWidthHistogramAggregation.Builder> op) {
op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field");
op.add(Builder::buckets, JsonpDeserializer.integerDeserializer(), "buckets");
op.add(Builder::shardSize, JsonpDeserializer.integerDeserializer(), "shard_size");
op.add(Builder::initialBuffer, JsonpDeserializer.integerDeserializer(), "initial_buffer");

I use the histogram API in log scale, so can this API supports script field?

@l-trotta l-trotta added the Area: Specification Related to the API spec used to generate client code label Mar 8, 2024
@l-trotta
Copy link
Contributor

l-trotta commented Mar 8, 2024

Hello, thanks for reporting this! You're correct, it seems like the field is missing from the API specification used to produce the Java code. It will be added soon and then the java code will be updated to solve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Specification Related to the API spec used to generate client code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants