SDK
SDK Dart Null Safety v3.x
2

searchSpecifications #

Searches collection specifications.

There is a limit on how many items can be returned by a single search query. That limit is by default set at 10000, and you can't get over it even with the from and size pagination options.

When processing a large number of items (i.e. more than 1000), it is advised to paginate the results using SearchResult.next rather than increasing the size parameter.


Future<SearchResult> searchSpecifications(
    String index, {
    Map<String, dynamic> query = Map(),
    int? from,
    int? size,
    String? scroll,
  })

ArgumentsTypeDescription
index
String
The index in which the collection is in
query
Map<String, dynamic>

({})
An object containing the search query
from
int

(0)
Offset of the first document to fetch
size
int

(10)
Maximum number of documents to retrieve per page
scroll
String

("")
When set, gets a forward-only cursor having its ttl set to the given value (ie 1s; cf elasticsearch time limits)

query body properties: #

An empty body matches all documents in the queried collection.

Return #

Returns a SearchResult object.

Usage #

final result = await kuzzle
  .collection
  .searchSpecifications(
    'nyc-open-data',
    query: {
      'query': {
        'match_all': {}
      }
    }, 
    from: 0, 
    size: 50, 
    scroll: '10s');