如果这是一个基本问题,我很抱歉,但这是我第一次与ES争执。你如何找到并索引一个Json文件到ES中进行索引?如何在弹性搜索集群中加载Json?
我已经看过ES文档和类似于我的问题,但迄今为止列出的所有方法都不适用于我。
Import/Index a JSON file into Elasticsearch
is there any way to import a json file(contains 100 documents) in elasticsearch server.?
我使用的是Mac OS和卷曲命令我使用_bulk我的JSON文件是这样的:
curl -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary "@accounts.json"
但是,这个错误弹出:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "Failed to derive xcontent"
}
],
"type": "parse_exception",
"reason": "Failed to derive xcontent"
},
"status": 400
}
考虑到Json文件是直接从这个链接中的Elastic.co文档页面中看到的:它看起来已经是这种格式了:https://www.elastic.co/guide/en/elasticsearch/reference/current /_exploring_your_data.html – MLhacker
为防万一它不是问题的位置,我已将json文件放在与elasticsearch.bat文件所在的目录以及elasticsearch文件夹中的其他位置相同的目录中,但似乎没有解决这个问题。 – MLhacker
elasticsearch日志中的任何错误? – alpert