-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add POST /_search/clear_scroll endpoint and deprecate delete scroll endpoint #21510
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,15 +134,15 @@ GET /_nodes/stats/indices/search | |
|
||
==== Clear scroll API | ||
|
||
Search context are automatically removed when the `scroll` timeout has been | ||
Search contexts are automatically removed when the `scroll` timeout has been | ||
exceeded. However keeping scrolls open has a cost, as discussed in the | ||
<<scroll-search-context,previous section>> so scrolls should be explicitly | ||
cleared as soon as the scroll is not being used anymore using the | ||
`clear-scroll` API: | ||
cleared as soon as they are not being used anymore using the `clear-scroll` | ||
API: | ||
|
||
[source,js] | ||
--------------------------------------- | ||
DELETE /_search/scroll | ||
POST /_search/clear_scroll | ||
{ | ||
"scroll_id" : ["DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ=="] | ||
} | ||
|
@@ -154,7 +154,7 @@ Multiple scroll IDs can be passed as array: | |
|
||
[source,js] | ||
--------------------------------------- | ||
DELETE /_search/scroll | ||
POST /_search/clear_scroll | ||
{ | ||
"scroll_id" : [ | ||
"DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==", | ||
|
@@ -165,23 +165,24 @@ DELETE /_search/scroll | |
// CONSOLE | ||
// TEST[catch:missing] | ||
|
||
All search contexts can be cleared with the `_all` parameter: | ||
The recommended way to provide the `scroll_id` is by placing it in the request | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly replace this block with:
|
||
body using the `POST` verb against the `clear_scroll` endpoint added[5.2.0]. | ||
All of the other ways to provide the `scroll_id`, either as a url parameter or | ||
as part of the request body using the `DELETE /_search/scroll` endpoint, are | ||
deprecated deprecated[5.2.0]. | ||
|
||
[source,js] | ||
--------------------------------------- | ||
DELETE /_search/scroll/_all | ||
--------------------------------------- | ||
// CONSOLE | ||
|
||
The `scroll_id` can also be passed as a query string parameter or in the request body. | ||
Multiple scroll IDs can be passed as comma separated values: | ||
All search contexts can be cleared with the special `_all` scroll id: | ||
|
||
[source,js] | ||
--------------------------------------- | ||
DELETE /_search/scroll/DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==,DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAABFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAAAxZrUllkUVlCa1NqNmRMaUhiQlZkMWFBAAAAAAAAAAIWa1JZZFFZQmtTajZkTGlIYkJWZDFhQQAAAAAAAAAFFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAABBZrUllkUVlCa1NqNmRMaUhiQlZkMWFB | ||
POST /_search/clear_scroll | ||
{ | ||
"scroll_id" : [ | ||
"_all" | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one looks a bit odd, looked better providing _all as part of the url, but maybe that's ok There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps this could be replaced with supporting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually we probably don't support wildcard matching, so using |
||
} | ||
--------------------------------------- | ||
// CONSOLE | ||
// TEST[catch:missing] | ||
|
||
[[sliced-scroll]] | ||
==== Sliced Scroll | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"clear_scroll": { | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-request-scroll.html", | ||
"methods": ["DELETE"], | ||
"methods": ["POST"], | ||
"url": { | ||
"path": "/_search/scroll/{scroll_id}", | ||
"paths": ["/_search/scroll/{scroll_id}", "/_search/scroll"], | ||
"path": "/_search/clear_scroll/{scroll_id}", | ||
"paths": ["/_search/clear_scroll/{scroll_id}", "/_search/clear_scroll"], | ||
"parts": { | ||
"scroll_id": { | ||
"type" : "list", | ||
|
@@ -14,7 +14,7 @@ | |
"params": {} | ||
}, | ||
"body": { | ||
"description": "A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter" | ||
"description": "A comma-separated list of scroll IDs to clear, has the precedence over the scroll_id parameter" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. has precedence |
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why add this at all? This will result in adding a new method to the clients. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it just there for bwc testing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no you are right. it is a leftover, due to the fact that I had thought POST shouldn't support the query_string parameter at all, now that it does, I can get right of this new api. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh wait though, DELETE is done against _search/scroll while POST is done against _search/clear_scroll . I don't think we can express that in our spec without having two apis. POST _search/scroll is already taken by the search api. |
||
"delete_scroll": { | ||
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/5.x/search-request-scroll.html", | ||
"methods": ["DELETE"], | ||
"url": { | ||
"path": "/_search/scroll/{scroll_id}", | ||
"paths": ["/_search/scroll/{scroll_id}", "/_search/scroll"], | ||
"parts": { | ||
"scroll_id": { | ||
"type" : "list", | ||
"description" : "A comma-separated list of scroll IDs to clear" | ||
} | ||
}, | ||
"params": {} | ||
}, | ||
"body": { | ||
"description": "A comma-separated list of scroll IDs to clear, has the precedence over the scroll_id parameter" | ||
} | ||
} | ||
} |
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.
should rather -> must