-
Notifications
You must be signed in to change notification settings - Fork 114
Add cartesian_bounds, cartesian_centroid and change_point aggregations #5418
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
Conversation
Following you can find the validation changes against the target branch for the APIs.
You can validate these APIs yourself by using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thank you! I especially like the careful specification for the IMO tricky change point aggregation.
cardinality?: CardinalityAggregation | ||
/** | ||
* A metric aggregation that computes the spatial bounding box containing all values for a Point or Shape field. | ||
* @ext_doc_id search-aggregations-metrics-cartesian-bounds-aggregation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you need an entry in specification/_doc_ids/table.csv for ext_doc_id
to fully work. This also applies to change_point
and cartesian_centroid
.
export class NonStationary { | ||
p_value: double | ||
r_value: double | ||
trend: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could decide to make this an enum with increasing
and decreasing
values: https://github.com/elastic/elasticsearch/blob/414972d5c7f65fec11c9ac2b4f6c0baaf456abdc/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/changepoint/ChangeDetector.java#L482
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case I was referring to https://github.com/elastic/elasticsearch/blob/f9c72c17d18859e3511bd17fbff759ebe965b812/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/aggs/changepoint/ChangeType.java#L254, which is what's used by the response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I noticed trend
is a string in the server code, but in practice, there are only two values. Well, it's an implementation detail, so it's likely better not to rely on it. You're right.
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM.
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.19 8.19
# Navigate to the new working tree
cd .worktrees/backport-8.19
# Create a new branch
git switch --create backport-5418-to-8.19
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 23222d914f80f9858ad508ca6fb5b8749955d7bf
# Push it to GitHub
git push --set-upstream origin backport-5418-to-8.19
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.19 Then, create a pull request where the |
#5418) * fix search validation * add variants to changetype * Update specification/_types/aggregations/AggregationContainer.ts Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co> * add ext docs to table csv --------- Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co> (cherry picked from commit 23222d9)
#5418) * fix search validation * add variants to changetype * Update specification/_types/aggregations/AggregationContainer.ts Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co> * add ext docs to table csv --------- Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co> (cherry picked from commit 23222d9)
#5418) * fix search validation * add variants to changetype * Update specification/_types/aggregations/AggregationContainer.ts Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co> * add ext docs to table csv --------- Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co> (cherry picked from commit 23222d9)
#5418) (#5438) * fix search validation * add variants to changetype * Update specification/_types/aggregations/AggregationContainer.ts * add ext docs to table csv --------- (cherry picked from commit 23222d9) Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
#5418) (#5437) * fix search validation * add variants to changetype * Update specification/_types/aggregations/AggregationContainer.ts * add ext docs to table csv --------- (cherry picked from commit 23222d9) Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
#5418) (#5436) * fix search validation * add variants to changetype * Update specification/_types/aggregations/AggregationContainer.ts * add ext docs to table csv --------- (cherry picked from commit 23222d9) Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
#5418) (#5436) * fix search validation * add variants to changetype * Update specification/_types/aggregations/AggregationContainer.ts * add ext docs to table csv --------- (cherry picked from commit 23222d9) Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
…oint aggregations (#5439) * Add cartesian_bounds, cartesian_centroid and change_point aggregations (#5418) (#5436) * fix search validation * add variants to changetype * Update specification/_types/aggregations/AggregationContainer.ts * add ext docs to table csv --------- (cherry picked from commit 23222d9) Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co> * update ext doc table --------- Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
manually backported 8.19 #5439 |
These should all be safe to backport.