I can't load all documents from csv file using python

i'm trying to load csv file to Elasticsearch using python

from elasticsearch import Elasticsearch, helpers
import csv

# Elastic search configuation

es = Elasticsearch('http://IP:8081')

# Creating index
es.indices.create(index="suivipsi")

# Looking if the index exists
#es.indices.exists(index="firstindex")

# Open csv file and bulk upload
with open('Suivi_des_PSI_2.csv',encoding='utf-8') as f:
    reader = csv.DictReader(f)
    helpers.bulk(es, reader, index='suivipsi')

my csv file hase 8793 line but when index is created in elasticseach i found that just 334 document loaded

You probably want to check the response from Elasticsearch to see if there are any errors.
You can also check the Elasticsearch logs to see if there's anything there that might provide some hints.

@warkolm i found that he can load empty date documents is there a way to load that lines eventhought they are empty !!!

You will need to provide a date in there for it to be accepted.

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