elasticsearch学习笔记
一,利用管道读入文件
1.首先需要安装附件文本抽取插件:Ingest Attachment Processor Plugin:官方插件
2. 创建管道:
PUT http://localhost:9200/_ingest/pipeline/attachment("attachment"表示管道ID)
{
"description": "Extract attachment information",
"processors": [
{
"attachment": {
//创建文件抽取预处理器
"field": "data",//表示base64编码后的文件 存放的属性
"ignore_missing": true
}
},
{
//创建base64编码后移除无用的 data 属性 的预处理器,_source中将不会返回field为 "data"的属性
"remove": {
"field": "data"
}
}
]
}
- 建立文档映射结构
PUT http://localhost:9200/book(这里"book"为索引名)
{
"mappings": {
"idx": {
"properties": {
"id": {
"type": "keyword"
},
"title":