所需组件:
需在 kidana Dev Tools 中创建文本抽取管道 否则文件无法解析 PUT /_ingest/pipeline/attachment {
"description": "attachment information",
"processors": [
{
"attachment": {
"field": "file",
"ignore_missing": true
}
},
{
"remove": {
"field": "file"
}
}
]
}
创建索引: 该操作可依赖实体注解完成,analyzer(写入时分词),searchAnalyzer(搜索时分词) 分词参数不可丢失 否则会影响搜索
PUT /fileindex { "mappings": {
"properties": {
"id":{
"type": "keyword"
},
"content":{
"type": "text",
"analyzer": "ik_max_word",
"searchAnalyzer" = "ik_max_word"
},
"path":{
"type": "text"
},
"file":{
"type": "text",
"analyzer": "ik_max_word",
"searchAnalyzer" = "ik_max_word"
},
"attachment": {
"properties": {
"file":{
"type": "text",
"analyzer": "ik_smart",
"searchAnalyzer" = "ik_max_word"
}
}
}
}
} }
页面文件 live-web 所需组件 node
页面安装 npm i / yarn install
运行 npm run dev / yarn dev