Not able to instantiate ES object orientedly, the mapping types being removed are guilty

I tried to transform the creation of my database Elasticsearch, a script, in an object-oriented format but then create the database by instantiating it in the, and nothing else is passed: :

from Elastic import Elastic

el = Elastic()

print("server is ready") :

import csv
import glob
import os
from elasticsearch import helpers, Elasticsearch

class Elastic:
    def __init__(self):
        es = Elasticsearch()

        for path in glob.glob("*.csv"):
            with open(path, newline='') as csvfile:
                reader = csv.DictReader(csvfile, delimiter=';', quotechar='|')
                csv_name = os.path.splitext(path)[0]
                helpers.bulk(es, reader, index="index1", doc_type=csv_name)

But I get teh following message which don't seem to instantiate teh last object I tried to add :

You can find the data I try to add here

Annex :

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.