# スコア計算について

**URL:** https://discuss.elastic.co/t/topic/82578
**Category:** 日本語による質問・議論はこちら
**Created:** [April 17, 2017, 1:13pm UTC](https://discuss.elastic.co/t/topic/82578 "2017-04-17T13:13:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yuji\_kumada](https://avatars.discourse-cdn.com/v4/letter/y/f19dbf/32.png) [@yuji\_kumada](https://discuss.elastic.co/u/yuji_kumada)
#### Post date: [April 17, 2017, 1:13pm UTC](https://discuss.elastic.co/t/topic/82578/1 "2017-04-17T13:13:53Z")

</div>

いつもお世話になります。

Elasticsearchの検索スコア計算について、アドバイスをお願いします。

Elasticserach ver.1.4.1

TF（Document内のTermのマッチ率）  
IDF（INDEX内の全Documentに対する、Termを含んだDocumentの比率）  
DocumentのLengthがより短いもの  
50音順  
Boost

より、スコアを計算し検索結果をソートしていると考えておりますが、  
検索キーと検索結果が以下のようなパターンが出ており、上記の条件と合致しないように見えます。  
スコア計算に影響のある設定はない状態です。

キーワード：  
SCORETEST

検索結果  
SCORETESTCABLEKIT  
SCORETESTPIOS ←①  
SCORETESTMODB512M  
SCORETESTPI1CALCA  
SCORETESTPI3CALCB  
SCORETESTPI2CALCB ←②  
SCORETESTPI1CALCA ←③

アナライザ：bigram

① キーワードSCORETESTに対するTFは検索結果下位の"SCORETESTPIOS"が高いと思います。  
"SCORETESTPIOS" はLengthが検索上位の "SCORETESTCABLEKIT" より短いため  
検索結果は上位に上がるのではないでしょうか。

② キーワードSCORETESTに対するTFは同様と思います。  
次に、”SCORETESTPI2CALCB” は ”SCORETESTPI3CALCB” より50音で考えれば早く  
検索上位に上がるのではないでしょうか。

③ ②と同様

TF・IDFその他条件に対する理解が不足している場合、指摘していただければと思います。

何卒、よろしくお願いします。

---

<div class="post-metadata">

### Author: ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)
#### Post date: [April 28, 2017, 8:34am UTC](https://discuss.elastic.co/t/topic/82578/2 "2017-04-28T08:34:59Z")

</div>

Explainを使うとスコアの計算が詳しく表示されるので、まずはそれを見てみるのはどうでしょうか？

あと、クエリにはどんなものを使用しているのでしょうか？

[https://www.elastic.co/guide/en/elasticsearch/reference/1.4/search-request-explain.html](https://www.elastic.co/guide/en/elasticsearch/reference/1.4/search-request-explain.html)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 26, 2017, 8:42am UTC](https://discuss.elastic.co/t/topic/82578/3 "2017-05-26T08:42:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
