我是Elasticsearch的新手。我已經用Kibana,X-pack和攝入附件成功安裝了Elasticsearch。我同時運行Elasticsearch和Kibana。我現在在使用Windows 2012服務器上的默認選項進行安裝時保持了簡單。我在另一個驅動器w\mydocs
上有一個目錄,目前它只有3個純文本文件,但我想要添加其他類似pdf和doc文件類型的文件。所以現在我想把這些文件放到Elasticsearches索引中。我已經嘗試使用以下鏈接作爲指導Attaching pdf docs in Elasticsearch,但是我無法使其工作。如何使用elasticsearch索引文件5.5.1
下面是我已經建立了索引和管道:
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
}
所以現在如果我把以下內容:'PUT本地主機:9200 /文件/ 1 =管道文檔 ?{ 「數據」: 「BASE64_ENCODE( 'W:\\ \\ myDocs README.TXT')」 } '我收到非法的base64字符5f參數異常 – bilpor
您需要將文件內容轉換爲客戶端上的base64,然後將該字符串作爲數據字段發送。只需指定路徑不起作用。 – alr