【发布时间】:2018-01-09 22:11:17
【问题描述】:
我是 Elasticsearch 的新手。我已经成功安装了带有 Kibana、X-pack 和摄取附件的 Elasticsearch。我同时运行 Elasticsearch 和 Kibana。目前,我在 Windows 2012 服务器上使用默认选项进行安装,使其保持简单。我在另一个驱动器w\mydocs 上有一个目录,目前它只有 3 个纯文本文件,但我想添加其他文件类型,如 pdf 和 doc 文件类型。所以现在我想将这些文件放入 Elasticsearches 索引中。我尝试使用以下链接作为指南 Attaching pdf docs in Elasticsearch,但我无法让它工作。
这是我设置索引和管道的方式:
PUT _ingest/pipeline/docs
{
"description": "documents",
"processors" : [
{
"attachment" : {
"field": "data",
"indexed_chars" : -1
}
}]
}
PUT myindex
{
"mappings" : {
"documents" : {
"properties" : {
"attachment.data" : {
"type": "text",
"analyzer": "standard"
}
}
}
}
}
然后要获取第一个文档,我使用以下命令:
PUT localhost:9200/documents/1?pipeline=docs -d @/w/mydocs/README.TXT
我收到的错误是:
{
"error": {
"root_cause": [
{
"type": "parse_exception",
"reason": "request body is required"
}
],
"type": "parse_exception",
"reason": "request body is required"
},
"status": 400
}
【问题讨论】:
标签: elasticsearch kibana