Connecting to Elasticsearch with Python

For Legacy Support Purposes Only

In this example, we will use Python OpenSearch client library. 

Prerequisites

You need to install Python on your machine. Depending on your operating system, download and install python. Note: This sample code uses Python3.

  1. Installation

Install Python OpenSearch client package using pip

  2. Connecting to cluster

# SSL client authentication using client_cert and client_key

  3. Indexing
  4. Getting a document

Full sample code

Replace public IP, username and password with your real setting

 

Transparent, fair, and flexible pricing for your data infrastructureSee Instaclustr Pricing Here

By Instaclustr Support
Need Support?
Experiencing difficulties on the website or console?
Already have an account?
Need help with your cluster?
Contact Support
Why sign up?
To experience the ease of creating and managing clusters via the Instaclustr Console
Spin up a cluster in minutes