就是一个插件
mvn clean install 然后把生成的zip插件安装到ES中,具体操作如下:把生成的zip包放到指定目录下比如D:\plugins。进入es的bin目录执行 elasticsearch-plugin.bat install file:///D:\plugins\levi-replace-processsor-1.0.0-SNAPSHOT.zip 然后重启es,日志中会加载该组件。
PUT test-index
{
"settings": {
"number_of_replicas": 0
},
"mappings": {
"properties": {
"name":{
"type": "keyword"
}
}
}
}
PUT /_ingest/pipeline/my-filter_01
{
"processors": [
{
"levi_filter_word":{
"myfield":"你要替换哪个字段",
"myfilterWord":"你要替换的词"
}
}
]
}
POST test-index/_doc?pipeline=my-filter_01
{
"description":"nihao tmd"
}
GET my-index-01/_search