我可以使用Python加载来自CSV文件的所有文档
我正在尝试使用Python加载CSV文件到Elasticsearch,
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')
当我的CSV文件Hase 8763 Line Bunt在Elasticsearch中创建索引时,只有将334个木质加载到索引 如下所示 在此处输入图像描述
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 8763 line bunt when index is created in elasticsearch it gives that only 334 lignes are loaded to index
as shown below
enter image description here
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论