Implementation
This handler is implemented using theelasticsearch library, the Python Elasticsearch client.
The required arguments to establish a connection are as follows:
hostsis the host name(s) or IP address(es) of the Elasticsearch server(s). If multiple host name(s) or IP address(es) exist, they should be separated by commas. This parameter is optional, but it should be provided ifcloud_idis not.cloud_idis the unique ID to your hosted Elasticsearch cluster on Elasticsearch Service. This parameter is optional, but it should be provided ifhostsis not.usernameis the username used to authenticate with the Elasticsearch server. This parameter is optional.passwordis the password used to authenticate the user with the Elasticsearch server. This parameter is optional.
If you installed MindsDB locally via pip, you need to install all handler dependencies manually. To do so, go to the handler’s folder (mindsdb/integrations/handlers/elasticsearch_handler) and run this command:
pip install -r requirements.txt.Usage
In order to make use of this handler and connect to the Elasticsearch server in MindsDB, the following syntax can be used:There are certain limitations that need to be taken into account when issuing queries to Elasticsearch. You can find a detailed guide here.