第一节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" ] } } ] } }
<1>比<2>的_score高,因为<2>只匹配到rock,没有climbing
如果想精确匹配"rock climbing"这个单词的话,把match改成match_phrase来匹配短语
时间: 2024-11-09 07:46:39