Portal Community

When to Use

When not to use: If you already know document IDs, use document/get or document/getMany. Those are faster because they bypass the query engine entirely. Use document/search when you need relevance scoring, aggregations, or multi-clause filtering.

Configuration

Connection

FieldRequiredDescription
HostRequiredElasticsearch cluster URL, e.g. https://localhost:9200.
UsernameOptionalElasticsearch username (required if security is enabled).
PasswordOptionalPassword for the specified username.
IgnoreSSLOptionalDefault false. Skip TLS validation. Development use only.

Operation

FieldRequiredDescription
IndexNameRequiredThe index to search.
QueryRequiredA valid Elasticsearch Query DSL object. This is the query clause passed directly to the Elasticsearch Search API. Any query type is supported: match, bool, multi_match, term, range, match_all, etc.
LimitOptionalMaximum number of documents to return. Default 50. Ignored when ReturnAll is true.
ReturnAllOptionalDefault false. When true, automatically pages through all matching documents and returns the complete result set.
SimplifyOptionalDefault true. When true, each document in documents contains only the _source fields. When false, the full Elasticsearch hit metadata (_id, _score, _index) is included alongside _source in every document entry.
AggregationsOptionalAn Elasticsearch aggregations object. Passed directly as the aggs clause. Results are returned in the aggregations output field. Optional — omit if you only need documents.

Validation Errors

Error CodeCause
VAL_MISSING_INDEXIndexName is empty.
VAL_MISSING_QUERYQuery is null or empty. A Query DSL object is required for every search operation.

Output

Success Port

FieldTypeDescription
documentsarrayMatched documents. When Simplify is true (default), each entry contains only the document fields. When false, each entry includes _id, _score, _index, and _source.
totalHitsintegerTotal number of documents matching the query in the index. May exceed documents.length when Limit is applied.
aggregationsobjectAggregation results keyed by aggregation name. Empty object {} when no aggregations were requested.
statusstring"success"

Error Port

Fires on query parse errors, connection failures, authentication errors, or if the index does not exist. The error output contains errorCode and message fields.

Examples

Full-Text Product Search

{
  "resource": "document",
  "operation": "search",
  "IndexName": "products",
  "Query": {
    "multi_match": {
      "query": "{{ $json.searchTerm }}",
      "fields": ["title^3", "description", "tags"],
      "type": "best_fields"
    }
  },
  "Limit": 20
}

Searches across title (boosted 3×), description, and tags. Access results with {{ $output.searchProducts.documents }}.

Bool Query — Filtered Orders

{
  "resource": "document",
  "operation": "search",
  "IndexName": "orders",
  "Query": {
    "bool": {
      "must": [
        { "term": { "status": "pending" } }
      ],
      "filter": [
        { "range": { "createdAt": { "gte": "now-7d/d" } } },
        { "term": { "region": "{{ $json.region }}" } }
      ]
    }
  },
  "Limit": 50
}

Retrieves pending orders from the past 7 days in the specified region.

Search with Aggregations — Sales by Category

{
  "resource": "document",
  "operation": "search",
  "IndexName": "orders",
  "Query": {
    "range": {
      "createdAt": { "gte": "now-30d/d" }
    }
  },
  "Aggregations": {
    "sales_by_category": {
      "terms": { "field": "category.keyword", "size": 10 }
    },
    "total_revenue": {
      "sum": { "field": "amount" }
    }
  },
  "Limit": 0
}

Setting Limit: 0 returns only aggregations with no document data. Access results with {{ $output.salesReport.aggregations.sales_by_category.buckets }}.

Score Metadata — Disable Simplify

{
  "resource": "document",
  "operation": "search",
  "IndexName": "articles",
  "Query": {
    "match": { "body": "{{ $json.query }}" }
  },
  "Simplify": false,
  "Limit": 10
}

With Simplify: false, each document entry includes _id, _score, _index, and _source. Use _score to rank or threshold results downstream.