Skip to content

Commit

Permalink
adjusting scroll behavior for backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
brozeph committed Mar 5, 2019
1 parent 277fd5c commit af14be7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
@@ -1,3 +1,7 @@
# v0.7.1 / 2019-03-05

* Adjusted `scroll` method to construct proper scroll payload when only the ID is specified

# v0.7.0 / 2019-02-20

* Replaced `thenify` and `bluebird` dependencies with `babel`
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"name": "es",
"description": "API around the ElasticSearch RESTful API -- mostly convenience.",
"main": "dist",
"version": "0.7.0",
"version": "0.7.1",
"author": "Nick Campbell (http://github.com/ncb000gt)",
"contributors": [
"Nick Campbell (http://github.com/ncb000gt)",
Expand Down
8 changes: 8 additions & 0 deletions src/core.js
Expand Up @@ -577,6 +577,14 @@ class Core {
options.query = utils.exclude(options, this.paramExcludes);
options.path = utils.pathAppend('_search/scroll');

// re-map to payload expected by ES6
if (typeof scrollId === 'string') {
scrollId = {
scroll : options.scroll,
'scroll_id' : scrollId
};
}

// documentation indicates GET method...
// sending POST data via GET not typical, using POST instead
return this.request.post(options, scrollId, callback);
Expand Down

0 comments on commit af14be7

Please sign in to comment.