Skip to main content
Only available for Node.js.
The Elasticsearch datasource connects to Elasticsearch indices, allowing you to query, filter, and aggregate your data through Forest.

Basic usage

Configuration options

Index-based collections

Map each Elasticsearch index to a Forest collection:

Template-based collections

Use Elasticsearch index templates to automatically generate collections:

Authentication

The datasource supports multiple authentication methods:

SSL/TLS configuration

Field types

The datasource supports the following field types:
  • String - Text fields
  • Number - Numeric fields
  • Boolean - Boolean fields
  • Date - Date/datetime fields
  • StringList - Array of strings
  • Json - Nested objects (stored as JSON)
Arrays must be explicitly specified using the List suffix (e.g., StringList).

Query capabilities

Filtering

The datasource supports 16+ filter operators:
  • Equal, NotEqual
  • GreaterThan, LessThan
  • In, NotIn
  • Contains, StartsWith, EndsWith
  • Present, Blank
  • Match (full-text search)
  • And more

Sorting

Sort records by any field:

Aggregations

The datasource supports Elasticsearch aggregations for charts and analytics:
  • Count
  • Sum
  • Average
  • Min/Max
  • Terms aggregation (group by)

Native SQL queries

Execute Elasticsearch SQL queries directly:

Live Query

This datasource supports Live Query for advanced filtering and segmentation. Learn more about Live Queries

Limitations

  • No joins - Relationships between indices are not supported
  • No object sub-models - Nested objects are flattened to JSON fields
  • No geospatial types - Point fields are not supported
  • Array specification - Arrays must be manually specified with List suffix
  • Read-heavy - Optimized for search and analytics, not transactional workloads

Elasticsearch 8.x support

This datasource is built for Elasticsearch 8.x and uses the official @elastic/elasticsearch client. It supports:
  • Index templates
  • Data streams
  • Modern query DSL
  • SQL API
  • Security features (authentication, TLS)

Source code

This connector is open source. Browse the code or contribute on GitHub: @forestadmin-experimental/datasource-elasticsearch.