\ue283\uf32a\uf3c2
时间: 2023-12-07 17:39:25 浏览: 28
根据提供的两个引用,可以看出这是在Elasticsearch中创建索引和管道,用于将文档解析为可搜索的内容。其中,索引定义了文档的结构和字段类型,而管道则定义了如何处理文档中的附件并将其解析为可搜索的内容。
具体来说,以下是创建索引和管道的步骤:
1. 创建一个存储该文档的索引
```shell
POST file_index_test/_doc
{
"mappings": {
"info": {
"properties": {
"id": {
"type": "keyword"
},
"filename": {
"type": "text",
"analyzer": "ik_smart"
},
"attachment": {
"properties": {
"content": {
"type": "text",
"analyzer": "ik_smart"
},
"content_type": {
"type": "text",
"analyzer": "ik_smart"
},
"title": {
"type": "text",
"analyzer": "ik_smart"
}
}
}
}
}
}
}
```
2. 建立Ingest-Attachment通道
```shell
PUT _ingest/pipeline/simple_attachment
{
"description": "单文件管道流",
"processors": [
{
"attachment": {
"field": "data",
"properties": [
"content",
"title",
"content_type"
],
"ignore_missing": true
}
},
{
"remove": {
"field": "data"
}
}
]
}
```
以上是创建索引和管道的步骤,其中索引定义了文档的结构和字段类型,而管道则定义了如何处理文档中的附件并将其解析为可搜索的内容。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)