Skip to content

Search Response has completion_time and _cluster/details #2260

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

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

quux00
Copy link
Contributor

@quux00 quux00 commented Aug 29, 2023

Updates the spec for the response objects for POST _async_search, GET _async_search/:id, GET _async_search/status/:id and GET _search

Two high level changes have happened in 8.10:

  1. completion_time and completion_time_in_millis (async_search only) Add completion_time time field to async_search get and status response elasticsearch#97700

  2. Adding details metadata to the _clusters section of both async and synchronous search responses Add specific cluster error info, shard info and additional metadata for CCS when minimizing roundtrips elasticsearch#97731

export class ClusterDetails {
status: ClusterSearchStatusEnum
indices: string
took?: long
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the unit of this value? If it's millis, this should be DurationValue<UnitMillis> (both defined in _types/Time.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, a millis timestamp. I'll change it, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I copied the value from the took entry in SearchResponse:

This is the "same" took value (just in a different subsection), so should I have them consistent?

If yes, should I change the above one to DurationValue<UnitMillis> also?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually that usage is in a bunch of places. Not sure I want to update all those (?)

./specification/fleet/search/SearchResponse.ts:    took: long
./specification/rollup/rollup_search/RollupSearchResponse.ts:    took: long
./specification/_global/search/SearchResponse.ts:  took: long
./specification/_global/knn_search/KnnSearchResponse.ts:    took: long

quux00 added 2 commits August 31, 2023 16:02
Updates the spec for the response objects for `POST _async_search`, `GET _async_search/:id`,
`GET _async_search/status/:id` and `GET _search`

Two high level changes have happened in 8.10:

1) `completion_time` and `completion_time_in_millis` (async_search only) elastic/elasticsearch#97700

2) Adding `details` metadata to the `_clusters` section of both async and synchronous search responses elastic/elasticsearch#97731
@quux00 quux00 force-pushed the search/response-updates branch from 5dbf924 to a37c526 Compare August 31, 2023 16:02
@github-actions
Copy link
Contributor

Following you can find the validation results for the APIs you have changed.

API Status Request Response
async_search.delete 🟢 3/3 3/3
async_search.get 🟢 4/4 4/4
async_search.status 🟢 3/3 3/3
async_search.submit 🟢 6/6 6/6

You can validate these APIs yourself by using the make validate target.

Copy link
Member

@swallez swallez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks

@swallez swallez merged commit 676cf67 into main Sep 1, 2023
@swallez swallez deleted the search/response-updates branch September 1, 2023 12:56
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2023

The backport to 8.10 failed:

The process '/usr/bin/git' failed with exit code 1

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.10 8.10
# Navigate to the new working tree
cd .worktrees/backport-8.10
# Create a new branch
git switch --create backport-2260-to-8.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 676cf674188b2ff65f762fc9c79180ce9f97b7bf
# Push it to GitHub
git push --set-upstream origin backport-2260-to-8.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.10

Then, create a pull request where the base branch is 8.10 and the compare/head branch is backport-2260-to-8.10.

swallez pushed a commit that referenced this pull request Sep 1, 2023
Updates the spec for the response objects for `POST _async_search`, `GET _async_search/:id`,
`GET _async_search/status/:id` and `GET _search`

Two high level changes have happened in 8.10:

1) `completion_time` and `completion_time_in_millis` (async_search only) elastic/elasticsearch#97700

2) Adding `details` metadata to the `_clusters` section of both async and synchronous search responses elastic/elasticsearch#97731
swallez added a commit that referenced this pull request Sep 5, 2023
Updates the spec for the response objects for `POST _async_search`, `GET _async_search/:id`,
`GET _async_search/status/:id` and `GET _search`

Two high level changes have happened in 8.10:

1) `completion_time` and `completion_time_in_millis` (async_search only) elastic/elasticsearch#97700

2) Adding `details` metadata to the `_clusters` section of both async and synchronous search responses elastic/elasticsearch#97731

Co-authored-by: Michael Peterson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants