2014-09-04 58 views
0

我正在學習關於在elasticsearch中要求解釋的結果。我瞭解其中最重要的部分,但是有一個價值我找不到有關信息。下面是一個簡單匹配查詢的解釋部分,其中一個字段中的一個字段已經完成。這是結果:不瞭解elasticsearch的價值解釋結果

_explanation: 
    value: 4.715253 
    description: "weight(name:love in 604) [PerFieldSimilarity], result of:" 
    details: 
    - value: 4.715253 
    description: "fieldWeight in 604, product of:" 
    details: 
    - value: 1.0 
     description: "tf(freq=1.0), with freq of:" 
     details: 
     - value: 1.0 
     description: "termFreq=1.0" 
    - value: 4.715253 
     description: "idf(docFreq=57, maxDocs=2382)" 
    - value: 1.0 
     description: "fieldNorm(doc=604)" 

我在找數字604的含義,有沒有人有想法?

回答

1

604是文檔ID。

這是您傳遞給IndexSearcher.doc的ID號碼,通常是在首次搜索其他條件(文檔ID不保證保持不變)後從索引中獲取文檔存儲字段。

+0

在org.apache.lucene.search.Weight的javadoc中,我找到了doc的這個描述:文檔的ID相對於給定的上下文的讀者。但是這與彈性搜索的_id有關嗎?我想不是因爲它們完全不同。 – 2014-09-04 20:27:29

+0

對,他們不是一回事。 Lucene的docid用於使用搜索結果列表從索引中獲取文檔。它們並不意味着作爲持久性密鑰。就ElasticSearch而言,你不需要擔心它們。 ElasticSearch _id是它分配給文檔(或允許您分配)的唯一,持久標識符的一部分。 – femtoRgon 2014-09-04 21:17:10