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

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 

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

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

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

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

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

        fieldNorm(doc=0):                    0.5 

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

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

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

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

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

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

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

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

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













本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/6473226.html,如需转载请自行联系原作者



上一篇:如何确定oracle数据库的连接模式是专用,还是共享模式?


下一篇:数据库在磁盘上的存储布局HeapFile