Skip to content

Commit cbc5bdc

Browse files
committed
Merge branch 'develop-implement-scroll' of github.com:kuzzleio/sdk-javascript into develop-implement-scroll
Conflicts: src/kuzzleDataCollection.js test/kuzzleDataCollection/methods.test.js
2 parents 8406413 + b33a9de commit cbc5bdc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/kuzzleDataCollection.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ KuzzleDataCollection.prototype.fetchAllDocuments = function (options, cb) {
290290

291291
if (!cb && typeof options === 'function') {
292292
cb = options;
293-
options = null;
293+
options = {};
294294
}
295295

296296
// copying pagination options to the search filter
@@ -316,7 +316,7 @@ KuzzleDataCollection.prototype.fetchAllDocuments = function (options, cb) {
316316
if (searchResult instanceof KuzzleSearchResult) {
317317
if (searchResult.total > 10000 && !warnEmitted) {
318318
warnEmitted = true;
319-
console.warn('Usage of KuzzleDataCollection.fetchAllDocuments will fetch more than 10 000 document. To avoid performance issues, please use KuzzleDataCollection.search and KuzzleDataCollection.scroll requests'); // eslint-disable-line no-console
319+
console.warn('KuzzleDataCollection.fetchAllDocuments may return extremely large amounts of documents, which may cause performance issues. Unless you know what you are doing, consider using KuzzleDataCollection.search or KuzzleDataCollection.scroll instead'); // eslint-disable-line no-console
320320
}
321321

322322
searchResult.documents.forEach(document => {
@@ -478,7 +478,10 @@ KuzzleDataCollection.prototype.search = function (filters, options, cb) {
478478
};
479479

480480
/**
481-
* Scroll into a search result
481+
* A "scroll" option can be passed to search queries, creating persistent
482+
* paginated results.
483+
* This method can be used to manually get the next page of a search result,
484+
* instead of using KuzzleSearchResult.next()
482485
*
483486
* @param {string} scrollId
484487
* @param {object} [options]

0 commit comments

Comments
 (0)