Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/7/controllers/document/search/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ That limit is by default set at 10000 documents, and you can't get over it even
When processing a large number of documents (i.e. more than 1000), it is advised to paginate the results using [SearchResult.next](/sdk/js/7/core-classes/search-result/next) rather than increasing the size parameter.
:::

::: warning
When using a cursor with the `scroll` option, Elasticsearch has to duplicate the transaction log to keep the same result during the entire scroll session.
It can lead to memory leaks if a scroll duration too great is provided, or if too many scroll sessions are open simultaneously.
:::

::: info
<SinceBadge version="Kuzzle 2.2.0"/>
You can restrict the scroll session maximum duration under the `services.storage.maxScrollDuration` configuration key.
:::


<br/>

```js
Expand Down
10 changes: 10 additions & 0 deletions doc/7/core-classes/search-result/next/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ For that reason, this method is guaranteed to return consistent results, even if

This is the most consistent way to paginate results, however, this comes at a higher computing cost for the server.

::: warning
When using a cursor with the `scroll` option, Elasticsearch has to duplicate the transaction log to keep the same result during the entire scroll session.
It can lead to memory leaks if ascroll duration too great is provided, or if too many scroll sessions are open simultaneously.
:::

::: info
<SinceBadge version="Kuzzle 2.2.0"/>
You can restrict the scroll session maximum duration under the `services.storage.maxScrollDuration` configuration key.
:::

<<< ./snippets/scroll.js

### Strategy: sort / size
Expand Down
30 changes: 20 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
const
Kuzzle = require('./src/Kuzzle'),
{
Http,
WebSocket
} = require('./src/protocols'),
BaseController = require('./src/controllers/base'),
KuzzleAbstractProtocol = require('./src/protocols/abstract/common'),
KuzzleEventEmitter = require('./src/eventEmitter');
const Kuzzle = require('./src/Kuzzle');
const { Http, WebSocket } = require('./src/protocols');
const BaseController = require('./src/controllers/base');
const KuzzleAbstractProtocol = require('./src/protocols/abstract/common');
const KuzzleEventEmitter = require('./src/eventEmitter');
const {
SearchResultBase,
DocumentSearchResult,
ProfileSearchResult,
RoleSearchResult,
SpecificationSearchResult,
UserSearchResult
} = require('./src/controllers/searchResult');

if (typeof window !== 'undefined' && typeof BUILT === 'undefined') {
throw new Error('It looks like you are using the Nodejs version of Kuzzle SDK ' +
Expand All @@ -21,5 +25,11 @@ module.exports = {
WebSocket,
BaseController,
KuzzleAbstractProtocol,
KuzzleEventEmitter
KuzzleEventEmitter,
SearchResultBase,
DocumentSearchResult,
ProfileSearchResult,
RoleSearchResult,
SpecificationSearchResult,
UserSearchResult
};
Loading