document/getMany FormID 20306
Retrieve multiple documents from an index with an optional filter. Returns a paginated list of full document bodies. Use ReturnAll to scroll through all results automatically, or set Limit to cap the response size.
When to Use
- List all records: Retrieve every document in an index — for example, load all active products into a downstream mapping node to build a catalogue response.
- Filtered page fetch: Supply a simple field filter (e.g.
status: "active") to narrow results without writing a full Query DSL. For complex bool queries, multi-field full-text search, or aggregations, usedocument/searchinstead. - Batch processing: Pull a bounded set of documents (set
Limitto a fixed number) and process them in a loop node — useful for nightly data syncs or report generation. - Full index export: Enable
ReturnAllto page through all documents automatically, bypassing the default 50-document cap. Useful for data migration or audit workflows.
getMany vs search:
document/getMany uses a simple field-match filter. It does not support Query DSL constructs like bool, multi_match, range, or aggregations. If you need those, use document/search.
Configuration
Connection
| Field | Required | Description |
|---|---|---|
Host | Required | Elasticsearch cluster URL, e.g. https://localhost:9200. |
Username | Optional | Elasticsearch username (required if security is enabled). |
Password | Optional | Password for the specified username. |
IgnoreSSL | Optional | Default false. Skip TLS validation. Development use only. |
Operation
| Field | Required | Description |
|---|---|---|
IndexName | Required | The index to query. |
Limit | Optional | Maximum number of documents to return. Default 50. Ignored when ReturnAll is true. |
ReturnAll | Optional | Default false. When true, pages through all documents automatically and returns the complete result set regardless of size. |
Filter | Optional | A plain JSON object of field-value pairs used as a filter. Example: {"status": "active", "region": "us-east"}. All specified fields must match (implicit AND). Leave empty to return all documents up to the limit. |
Validation Errors
| Error Code | Cause |
|---|---|
VAL_MISSING_INDEX | IndexName is empty. |
Output
Success Port
| Field | Type | Description |
|---|---|---|
documents | array | List of document objects. Each entry is the full document body as stored in Elasticsearch, equivalent to _source from a get operation. |
totalHits | integer | Total number of matching documents in the index. May be greater than documents.length when Limit is applied and ReturnAll is false. |
Error Port
Fires on connection failure, authentication error, or if the index does not exist. The output contains errorCode and message fields.
Access documents downstream with
{{ $output.nodeName.documents }} — this is an array you can pass directly to a loop node. To check how many were returned vs the total available, compare {{ $output.nodeName.documents.length }} with {{ $output.nodeName.totalHits }}.
Examples
Retrieve All Active Products
{
"resource": "document",
"operation": "getMany",
"IndexName": "products",
"Limit": 100,
"Filter": {
"status": "active"
}
}
Returns up to 100 active products. Connect the output to a loop node and iterate over {{ $output.getProducts.documents }}.
Full Index Export with ReturnAll
{
"resource": "document",
"operation": "getMany",
"IndexName": "audit-log-2025",
"ReturnAll": true
}
Retrieves every document in the index regardless of count. Use for data migration or archive workflows where completeness is required.
Multi-Field Filter
{
"resource": "document",
"operation": "getMany",
"IndexName": "orders",
"Limit": 50,
"Filter": {
"status": "pending",
"region": "{{ $json.region }}"
}
}
All filter fields use an implicit AND — only documents matching every field are returned.