Skip to content

Commit 0216976

Browse files
committed
Adapt from & size to be part of the query instead of the body
1 parent a7dfef1 commit 0216976

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/kuzzle.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,14 @@ Kuzzle.prototype.query = function (queryArgs, query, options, cb) {
12571257
object.refresh = options.refresh;
12581258
}
12591259

1260+
if (options.from) {
1261+
object.from = options.from;
1262+
}
1263+
1264+
if (options.refresh) {
1265+
object.size = options.size;
1266+
}
1267+
12601268
if (options.metadata) {
12611269
Object.keys(options.metadata).forEach(function (meta) {
12621270
object.metadata[meta] = options.metadata[meta];

src/kuzzleDataCollection.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -339,17 +339,6 @@ KuzzleDataCollection.prototype.fetchAllDocuments = function (options, cb) {
339339
options = null;
340340
}
341341

342-
// copying pagination options to the search filter
343-
if (options) {
344-
if (options.from) {
345-
filters.from = options.from;
346-
}
347-
348-
if (options.size) {
349-
filters.size = options.size;
350-
}
351-
}
352-
353342
this.kuzzle.callbackRequired('KuzzleDataCollection.fetchAll', cb);
354343

355344
this.advancedSearch(filters, options, cb);

0 commit comments

Comments
 (0)