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 24, 2015
1 parent 65faecb commit 0bfa495
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 11 deletions.
133 changes: 133 additions & 0 deletions _po/ja/reference/functions/pgroonga-score.po
@@ -0,0 +1,133 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-10-24 16:24+0900\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"

msgid ""
"---\n"
"title: pgroonga.score function\n"
"layout: en\n"
"---"
msgstr ""
"---\n"
"title: pgroonga.score関数\n"
"layout: ja\n"
"---"

msgid "# `pgroonga.score` function"
msgstr "# `pgroonga.score`関数"

msgid "## Summary"
msgstr "## 概要"

msgid ""
"`pgroonga.score` function returns precision as a number. If a record is more p"
"recision against searched query, the record has more higher number."
msgstr ""
"`pgroonga.score`関数はマッチした度合いを数値で返します。もし、検索したクエリーに対してそのレコードがマッチしているほどそのレコードのスコアー"
"は高い数値になります。"

msgid "## Syntax"
msgstr "## 構文"

msgid ""
"You can use `pgroonga.score` function to get precision as a number. If a recor"
"d is more precision against searched query, the record has more higher number."
msgstr ""
"`pgroonga.score`関数を使うとマッチした度合いを数値で取得することができます。検索したクエリーに対してよりマッチしているレコードほど高い数値に"
"なります。"

msgid ""
"```text\n"
"double precision pgroonga.score(record)\n"
"```"
msgstr ""

msgid "`record` is a table name."
msgstr "`record`はテーブル名です。"

msgid "Assume that you have the following schema:"
msgstr "次のスキーマが定義されているとします。"

msgid ""
"```sql\n"
"CREATE TABLE score_memos (\n"
" id integer PRIMARY KEY,\n"
" content text\n"
");"
msgstr ""

msgid ""
"CREATE INDEX pgroonga_score_memos_content_index\n"
" ON score_memos\n"
" USING pgroonga (id, content);\n"
"```"
msgstr ""

msgid "`record` must be `score_memos`:"
msgstr "`record`は`score_memos`にします。"

msgid ""
"```sql\n"
"SELECT *, pgroonga.score(score_memos)\n"
" FROM score_memos\n"
" WHERE content %% 'PGroonga';\n"
"```"
msgstr ""

msgid "`pgroonga.score` function return precision as `double precision` type value."
msgstr "`pgroonga.score`関数は`double precision`型の値でマッチした度合いを返します。"

msgid "## Usage"
msgstr "## 使い方"

msgid ""
"You need to add primary key column into `pgroonga` index to use `pgroonga.scor"
"e` function. If you don't add primary key column into `pgroonga` index, `pgroo"
"nga.score` function always returns `0.0`."
msgstr ""
"`pgroonga.score`関数を使うには、`pgroonga`インデックスにプライマリーキーに指定したカラムを追加する必要があります。もし、プライマリ"
"ーキーに指定したカラムを`pgroonga`インデックスに追加していない場合は、`pgroonga.score`関数は常に`0.0`を返します。"

msgid ""
"`pgroonga.score` function always returns `0.0` when full text search isn't per"
"formed by index. In other words, `pgroonga.score` function always returns `0.0"
"` when full text search is performed by sequential scan."
msgstr ""
"`pgroonga.score`関数はインデックスを使わずに全文検索した場合は常に`0.0`を返します。言い換えると、`pgroonga.score`関数は"
"シーケンシャルスキャンで全文検索を実行した場合は常に`0.0`を返します。"

msgid ""
"If `pgroonga.score` function returns `0.0` unexpectedly, confirm the following"
"s:"
msgstr "もし、`pgroonga.score`関数が意図せずに`0.0`を返しているときは、次のことを確認してください。"

msgid ""
" * Whether the column that is specified as primary key is included in index t"
"argets of the PGroonga index or not\n"
" * Whether the full text search is performed by index or not"
msgstr ""
" * プライマリーキーに指定しているカラムがPGroongaのインデックス対象に含まれているかどうか\n"
" * インデックスを使って全文検索されているかどうか"

msgid ""
"Score is \"how many keywords are included\" (TF, Term Frequency) for now. Groong"
"a supports customizing how to score. But PGroonga doesn't support yet it for n"
"ow."
msgstr ""
"現在のところ、スコアーの値は「何個キーワードが含まれていたか」(TF、Term Frequency)です。Groongaはどのようにスコアーを計算するかをカ"
"スタマイズすることができます。しかし、PGroongaはまだその機能をサポートしていません。"

msgid "See [examples in tutorial](../../tutorial/#score)."
msgstr "[チュートリアルの中の例](../../tutorial/#score)を参考にしてください。"

msgid "## See also"
msgstr "## 参考"

msgid " * [Examples in tutorial](../../tutorial/#score)"
msgstr " * [チュートリアルの中の例](../../tutorial/#score)"
64 changes: 64 additions & 0 deletions ja/reference/functions/pgroonga-score.md
@@ -0,0 +1,64 @@
---
title: pgroonga.score関数
layout: ja
---

# `pgroonga.score`関数

## 概要

`pgroonga.score`関数はマッチした度合いを数値で返します。もし、検索したクエリーに対してそのレコードがマッチしているほどそのレコードのスコアーは高い数値になります。

## 構文

`pgroonga.score`関数を使うとマッチした度合いを数値で取得することができます。検索したクエリーに対してよりマッチしているレコードほど高い数値になります。

```text
double precision pgroonga.score(record)
```

`record`はテーブル名です。

次のスキーマが定義されているとします。

```sql
CREATE TABLE score_memos (
id integer PRIMARY KEY,
content text
);

CREATE INDEX pgroonga_score_memos_content_index
ON score_memos
USING pgroonga (id, content);
```

`record``score_memos`にします。

```sql
SELECT *, pgroonga.score(score_memos)
FROM score_memos
WHERE content %% 'PGroonga';
```

`pgroonga.score`関数は`double precision`型の値でマッチした度合いを返します。

## 使い方

`pgroonga.score`関数を使うには、`pgroonga`インデックスにプライマリーキーに指定したカラムを追加する必要があります。もし、プライマリーキーに指定したカラムを`pgroonga`インデックスに追加していない場合は、`pgroonga.score`関数は常に`0.0`を返します。

`pgroonga.score`関数はインデックスを使わずに全文検索した場合は常に`0.0`を返します。言い換えると、`pgroonga.score`関数はシーケンシャルスキャンで全文検索を実行した場合は常に`0.0`を返します。

もし、`pgroonga.score`関数が意図せずに`0.0`を返しているときは、次のことを確認してください。

* プライマリーキーに指定しているカラムがPGroongaのインデックス対象に含まれているかどうか
* インデックスを使って全文検索されているかどうか

現在のところ、スコアーの値は「何個キーワードが含まれていたか」(TF、Term Frequency)です。Groongaはどのようにスコアーを計算するかをカスタマイズすることができます。しかし、PGroongaはまだその機能をサポートしていません。

## 使い方

[チュートリアルの中の例](../../tutorial/#score)を参考にしてください。

## 参考

* [チュートリアルの中の例](../../tutorial/#score)
10 changes: 5 additions & 5 deletions ja/reference/jsonb.md
Expand Up @@ -5,11 +5,11 @@ layout: ja

# `jsonb`サポート

PGroongaは`jsonb`型もサポートしています。PGroongaを使うと複数のキー・値に対して条件を指定してJSONデータを検索できます
PGroongaは`jsonb`型にも対応しています。PGroongaを使うとJSON中のキー・値に対して検索することができます

JSON内のすべてのテキスト値に対して全文検索をしてJSONデータを検索することもできます。これはPostgreSQL組み込みの機能でも[JsQuery](https://github.com/postgrespro/jsquery)でもサポートしていない機能です
JSON中のすべてのテキスト値に対して全文検索することもできます。これはPGroonga独自の機能です。PostgreSQL組み込みの機能でも[JsQuery](https://github.com/postgrespro/jsquery)でもこの機能はサポートしていません

次のようなJSONを考えてください
次のJSONを考えてください

```json
{
Expand All @@ -21,11 +21,11 @@ JSON内のすべてのテキスト値に対して全文検索をしてJSONデー
}
```

`search`でも`example`でも`web`でもどの単語で全文検索してもこのJSONを検索することができます。なぜなら、すべてのテキスト値が全文検索対象だからです。
`search``example``web`のどれで全文検索してもこのJSONを見つけることができます。なぜなら、すべてのテキスト値が全文検索対象だからです。

## 演算子

PGroongaは`jsonb`型の値で検索するために次の2つの演算子を提供しています
PGroongaは`jsonb`に対して検索するために次の2つの演算子を提供しています

* [`@>`演算子](operators/jsonb-contain.html)
* [`@@`演算子](operators/jsonb-query.html)
Expand Down
10 changes: 5 additions & 5 deletions ja/tutorial/index.md
Expand Up @@ -433,11 +433,11 @@ SELECT * FROM products WHERE tags %% 'PostgreSQL';

## JSONに対してPGroongaを使う方法

PGroongaは`jsonb`型もサポートしています。PGroongaを使うと複数のキー・値に対して条件を指定してJSONデータを検索できます
PGroongaは`jsonb`型にも対応しています。PGroongaを使うとJSON中のキー・値に対して検索することができます

JSON内のすべてのテキスト値に対して全文検索をしてJSONデータを検索することもできます。これはPostgreSQL組み込みの機能でも[JsQuery](https://github.com/postgrespro/jsquery)でもサポートしていない機能です
JSON中のすべてのテキスト値に対して全文検索することもできます。これはPGroonga独自の機能です。PostgreSQL組み込みの機能でも[JsQuery](https://github.com/postgrespro/jsquery)でもこの機能はサポートしていません

次のようなJSONを考えてください
次のJSONを考えてください

```json
{
Expand All @@ -449,9 +449,9 @@ JSON内のすべてのテキスト値に対して全文検索をしてJSONデー
}
```

`search`でも`example`でも`web`でもどの単語で全文検索してもこのJSONを検索することができます。なぜなら、すべてのテキスト値が全文検索対象だからです。
`search``example``web`のどれで全文検索してもこのJSONを見つけることができます。なぜなら、すべてのテキスト値が全文検索対象だからです。

PGroongaは`jsonb`型の値で検索するために次の2つの演算子を提供しています
PGroongaは`jsonb`に対して検索するために次の2つの演算子を提供しています

* `@>`演算子
* `@@`演算子
Expand Down
2 changes: 1 addition & 1 deletion reference/functions/pgroonga-score.md
Expand Up @@ -46,7 +46,7 @@ SELECT *, pgroonga.score(score_memos)

You need to add primary key column into `pgroonga` index to use `pgroonga.score` function. If you don't add primary key column into `pgroonga` index, `pgroonga.score` function always returns `0.0`.

`pgroonga.score` function always returns `0.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.
`pgroonga.score` function always returns `0.0` when full text search isn't performed by index. In other words, `pgroonga.score` function always returns `0.0` when full text search is performed by sequential scan.

If `pgroonga.score` function returns `0.0` unexpectedly, confirm the followings:

Expand Down

0 comments on commit 0bfa495

Please sign in to comment.