All Connectors
Elasticsearch Native Data Connector
Elasticsearch Native Data Connector
Elasticsearch Native Data Connector
The Hasura Elasticsearch Connector allows for connecting to a Elasticsearch search engine, giving you an instant GraphQL API on top of your Elasticsearch data.
About
Version
Released
June 24, 2024
Last Updated
November 16, 2024
GitHub Repo

Elasticsearch Connector

Docs ndc-hub License

With this connector, Hasura allows you to instantly create a real-time GraphQL API on top of your documents in Elasticsearch. This connector supports Elasticsearch functionalities listed in the table below, allowing for efficient and scalable data operations. Additionally, you will benefit from all the powerful features of Hasura’s Data Delivery Network (DDN) platform, including query pushdown capabilities that delegate all query operations to the Elasticsearch, thereby enhancing query optimization and performance.

This connector is built using the Go Data Connector SDK and implements the Data Connector Spec.

Docs for the Elasticsearch data connector:

Features

Below, you'll find a matrix of all supported features for the Elasticsearch connector:

FeatureSupportedNotes
Native Queries + Logical Models
Simple Object Query
Filter / Search
Simple Aggregation
Sort
Paginate
Nested Objects
Nested Arrays
Nested Filtering
Nested Sorting
Relationships

Prerequisites

  1. Create a Hasura Cloud account
  2. Please ensure you have the DDN CLI and Docker installed
  3. Create a supergraph
  4. Create a subgraph

The steps below explain how to initialize and configure a connector on your local machine (typically for development purposes).You can learn how to deploy a connector to Hasura DDN — after it's been configured — here.

Using the Elasticsearch connector

With the context set for an existing subgraph, initialize the connector:

ddn connector init -i

When the wizard runs, you'll be prompted to enter the following env vars necessary for your connector to function:

Environment VariableDescriptionRequiredExample Value
ELASTICSEARCH_URLThe comma-separated list of Elasticsearch host addresses for connection (Use local.hasura.dev instead of localhost if your connector is running on your local machine)Yeshttps://example.es.gcp.cloud.es.io:9200
ELASTICSEARCH_USERNAMEThe username for authenticating to the Elasticsearch clusterYesadmin
ELASTICSEARCH_PASSWORDThe password for the Elasticsearch user accountYesdefault
ELASTICSEARCH_API_KEYThe Elasticsearch API key for authenticating to the Elasticsearch clusterNo
ABCzYWk0NEI0aDRxxxxxxxxxx1k6LWVQa2gxMUpRTUstbjNwTFIzbGoyUQ==
ELASTICSEARCH_CA_CERT_PATHThe path to the Certificate Authority (CA) certificate for verifying the Elasticsearch server's SSL certificateNo/etc/connector/cacert.pem
ELASTICSEARCH_INDEX_PATTERNThe pattern for matching Elasticsearch indices, potentially including wildcards, used by the connectorNohasura*

After the CLI initializes the connector, you'll need to:

Contributing

Check out our contributing guide for more details.

License

The Elasticsearch connector is available under the Apache License 2.0.

2024 Edition

The GraphQL Handbook

A GraphQL Handbook for developers and architects to help plan your GraphQL adoption journey.
The GraphQL Handbook

Ship a rock-solid API on your data – in minutes!