Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want a way to actually upload datasets in elasticsearch, and there are things I cannot find a way to solve and the documents made me so much confused that I'm brain frozen!

What I have tried:

I used elasticsearch python package installed via pip and I'm using a Docker container to run a cluster of ElasticSearch. I want something like this:
Python
from elasticsearch import Elasticsearch, helpers
import csv, datetime

# Password for the 'elastic' user generated by Elasticsearch
ELASTIC_PASSWORD = "*****************"

# Create the client instance
es = Elasticsearch(
    "https://localhost:9200",
    ca_certs="/home/couzhei/code/FastAPI-stacks/Paya/http_ca.crt",
    basic_auth=("elastic", ELASTIC_PASSWORD)
)

# This is almost pseudo code
for dataset in es.all_indices():
    print(dataset.name, dataset.created_at, dataset.size)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900