1. 程式人生 > >elasticsearch之分詞查詢

elasticsearch之分詞查詢

elasticsearch

使用elk時,search時默認帶有分詞功能,搜索關鍵字並不精準,為方便search查詢,將分詞功能禁用:

curl -XPUT http://localhost:9200/_template/template_1 -d ‘{

"template" : "*",

"order":0,

"settings":{

"number_of_shards":5

},

"mappings":{

"fluentd":{

"properties":{

"request_dir":{"type":"string","index":"not_analyzed"},

"http_user_agent":{"type":"string","index":"not_analyzed"}

}

}

}

}‘

其中:not_analyzed參數是禁用分詞。analyzed:啟用分詞

本文出自 “努力奔小康” 博客,請務必保留此出處http://302876016.blog.51cto.com/12889292/1948433

elasticsearch之分詞查詢