This documentation describes the integration of MindsDB with ElasticSearch, a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.. The integration allows MindsDB to access data from ElasticSearch and enhance ElasticSearch with AI capabilities.
Before proceeding, ensure the following prerequisites are met:
Establish a connection to ElasticSearch from MindsDB by executing the following SQL command and providing its handler name as an engine.
The connection parameters include the following:
cloud_id
: The Cloud ID provided with the ElasticSearch deployment. Required only when hosts
is not provided.hosts
: The ElasticSearch endpoint provided with the ElasticSearch deployment. Required only when cloud_id
is not provided.api_key
: The API key that you generated for the ElasticSearch deployment. Required only when user
and password
are not provided.user
and password
: The user and password used to authenticate. Required only when api_key
is not provided.If you want to connect to the local instance of ElasticSearch, use the below statement:
Required connection parameters include the following (at least one of these parameters should be provided):
hosts
: The IP address and port where ElasticSearch is deployed.user
: The user used to autheticate access.password
: The password used to autheticate access.Retrieve data from a specified index by providing the integration name and index name:
The above examples utilize elasticsearch_datasource
as the datasource name, which is defined in the CREATE DATABASE
command.
At the moment, the Elasticsearch SQL API has certain limitations that have an impact on the queries that can be issued via MindsDB. The most notable of these limitations are listed below:
SELECT
queries are supported at the moment..
operator.For a detailed guide on the limitations of the Elasticsearch SQL API, refer to the official documentation.
Database Connection Error
Transport Error
or Request Error
SELECT
query..
operator.SQL statement cannot be parsed by mindsdb_sql
This troubleshooting guide provided by Elasticsearch might also be helpful.