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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.