首页 > 其他 > 详细

elasticsearch之分词查询

时间:2017-07-18 11:33:17      阅读:331      评论:0      收藏:0      [点我收藏+]

使用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之分词查询

原文:http://302876016.blog.51cto.com/12889292/1948433

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!