首页 > 数据库技术 > 详细

ES 搜索结果expalain 可以类似数据库性能调优来看排序算法的选择

时间:2017-02-27 13:42:08      阅读:349      评论:0      收藏:0      [点我收藏+]

When we run a simple term query with explain set to true (see Understanding the Score), you will see that the only factors involved in calculating the score are the ones explained in the preceding sections:

PUT /my_index/doc/1
{ "text" : "quick brown fox" }

GET /my_index/doc/_search?explain
{
  "query": {
    "term": {
      "text": "fox"
    }
  }
}

The (abbreviated) explanation from the preceding request is as follows:

weight(text:fox in 0) [PerFieldSimilarity]:  0.15342641 

技术分享

result of:
    fieldWeight in 0                         0.15342641
    product of:
        tf(freq=1.0), with freq of 1:        1.0 

技术分享

        idf(docFreq=1, maxDocs=1):           0.30685282 

技术分享

        fieldNorm(doc=0):                    0.5 

技术分享

技术分享

The final score for term fox in field text in the document with internal Lucene doc ID 0.

技术分享

The term fox appears once in the text field in this document.

技术分享

The inverse document frequency of fox in the text field in all documents in this index.

技术分享

The field-length normalization factor for this field.

Of course, queries usually consist of more than one term, so we need a way of combining the weights of multiple terms. For this, we turn to the vector space model.

 

见:https://www.elastic.co/guide/en/elasticsearch/guide/current/scoring-theory.html

ES 搜索结果expalain 可以类似数据库性能调优来看排序算法的选择

原文:http://www.cnblogs.com/bonelee/p/6473226.html

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