码迷,mamicode.com
首页 > 其他好文 > 详细

Elasticsearch 权威指南 ---内容记录

时间:2015-09-11 12:05:53      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

第一节
Relational DB -> Databases -> Tables -> Rows -> Columns Elasticsearch -> Indices -> Types -> Documents -> Fields
1.6小节
"
match" : { "about" : "rock climbing" }

会hit到两条记录如下:

技术分享
{
   ...
   "hits": {
      "total":      2,
      "max_score":  0.16273327,
      "hits": [
         {
            ...
            "_score":         0.16273327, <1>
            "_source": {
               "first_name":  "John",
               "last_name":   "Smith",
               "age":         25,
               "about":       "I love to go rock climbing",
               "interests": [ "sports", "music" ]
            }
         },
         {
            ...
            "_score":         0.016878016, <2>
            "_source": {
               "first_name":  "Jane",
               "last_name":   "Smith",
               "age":         32,
               "about":       "I like to collect rock albums",
               "interests": [ "music" ]
            }
         }
      ]
   }
}
View Code

<1>比<2>的_score高,因为<2>只匹配到rock,没有climbing

如果想精确匹配"rock climbing"这个单词的话,把match改成match_phrase来匹配短语

 

 

 

Elasticsearch 权威指南 ---内容记录

标签:

原文地址:http://www.cnblogs.com/tomboy/p/4800341.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!