Navigation Menu

Skip to content

Commit

Permalink
Translate pgroonga.score
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 8, 2015
1 parent 0184ba5 commit 1a299ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 9 additions & 9 deletions reference/functions/pgroonga-score.md
Expand Up @@ -5,17 +5,17 @@ layout: en

# `pgroonga.score` function

TODO
You can use `pgroonga.score` function to retrieve score as number. Score is how the record is precise.

`pgroonga.score` function always returns `0` when full text search is performed by sequential scan not index scan.
You need to add the column that is specified as primary key to index targets to use `pgroonga.score` function. If your PGroonga index doesn't have the column that is specified as primary key, `pgroonga.score` function always returns `0`.

スコアーが返るはずなのに`0`が返るときは次の2点を確認してください。
`pgroonga.score` function always returns `0` when full text search isn't performed by index. In other words, `pgroonga.score` function always returns `0` when full text search is performed by sequential scan.

* プライマリーキーのカラムがインデックス対象に含まれているか
* インデックスを使って全文検索を実行しているか
If `pgroonga.score` function returns `0` unexpectedly, confirm the followings:

* Whether the column that is specified as primary key is included in index targets of the PGroonga index or not
* Whether the full text search is performed by index or not

現時点では適合度は「キーワードを含んでいる数」になります。Groongaには
キーワードや検索対象カラム毎に重みをつける機能や適合度の計算方法をカス
タマイズする機能があります。しかし、PostgreSQLらしく指定するAPIを思い
ついていないためPGroongaから使うことはできません。
Score is "how many keywords are included" (TF, Term Frequency) for now. Groonga supports customizing how to score. But PGroonga doesn't support yet it for now.

See also [examples in tutorial](../../tutorial/#score).
2 changes: 2 additions & 0 deletions tutorial/index.md
Expand Up @@ -125,6 +125,8 @@ SELECT * FROM memos WHERE content %% '全文検索';

See [LIKE operator](../reference/operators/like.html) for more details.

{: #score}

### Score

You can use `pgroonga.score` function to get precision as a number. If a record is more precision against searched query, the record has more higher number.
Expand Down

0 comments on commit 1a299ed

Please sign in to comment.