Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
297 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,189 @@ | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: PACKAGE VERSION\n" | ||
| "PO-Revision-Date: 2015-10-24 17:16+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.table_name function\n" | ||
| "layout: en\n" | ||
| "---" | ||
| msgstr "" | ||
| "---\n" | ||
| "title: pgroonga.table_name関数\n" | ||
| "layout: ja\n" | ||
| "---" | ||
|
|
||
| msgid "# `pgroonga.table_name` function" | ||
| msgstr "# `pgroonga.table_name`関数" | ||
|
|
||
| msgid "## Summary" | ||
| msgstr "## 概要" | ||
|
|
||
| msgid "" | ||
| "`pgroonga.table_name` function converts PGroonga index name to Groonga table n" | ||
| "ame. Groonga table name is useful [`select` Groonga command](http://groonga.or" | ||
| "g/docs/reference/commands/select.html) by [`pgroonga.command` function](pgroon" | ||
| "ga-command.html)." | ||
| msgstr "" | ||
| "`pgroonga.table_name`関数はPGroongaのインデックス名をGroongaのテーブル名に変換します。Groongaのテーブル名は[`p" | ||
| "groonga.command`関数](pgroonga-command.html)で[Groongaの`select`コマンド](http://groon" | ||
| "ga.org/ja/docs/reference/commands/select.html)を使うときに便利です。" | ||
|
|
||
| msgid "You can use weight feature by `select` Groonga command." | ||
| msgstr "Groongaの`select`コマンドを使うと重み機能を使えます。" | ||
|
|
||
| msgid "## Syntax" | ||
| msgstr "## 構文" | ||
|
|
||
| msgid "Here is the syntax of this function:" | ||
| msgstr "この関数の構文は次の通りです。" | ||
|
|
||
| msgid "" | ||
| "```text\n" | ||
| "text pgroonga.table_name(pgroonga_index_name)\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "`pgroonga_index_name` is a `text` type value. It's an index name to be convert" | ||
| "ed to Groonga table name. The index should be created with `USING pgroonga`." | ||
| msgstr "" | ||
| "`pgroonga_index_name`は`text`型の値です。このインデックス名をGroongaのテーブル名に指定します。このインデックスは`USIN" | ||
| "G pgroonga`で作ったインデックスでなければいけません。" | ||
|
|
||
| msgid "" | ||
| "`pgroonga.table_name` returns Groonga table name for `pgroonga_index_name` as " | ||
| "`text` type value. If `pgroonga_index_name` doesn't exist or isn't a PGroonga " | ||
| "index, `pgroonga.table_name` raises an error." | ||
| msgstr "" | ||
| "`pgroonga.table_name`は`pgroonga_index_name`に対応するGroongaのテーブル名を`text`型の値として返します" | ||
| "。もし、`pgroonga_index_name`が存在していない、または、PGroongaのインデックスでない場合は、`pgroonga.table_na" | ||
| "me`はエラーにします。" | ||
|
|
||
| msgid "## Usage" | ||
| msgstr "## 使い方" | ||
|
|
||
| msgid "" | ||
| "Here are sample schema and data. In the schema, both search target data and ou" | ||
| "tput data are index target columns:" | ||
| msgstr "以下はサンプルのスキーマとデータです。このスキーマでは、検索対象のデータと出力対象のデータはどちらもインデックス対象のカラムです。" | ||
|
|
||
| msgid "" | ||
| "```sql\n" | ||
| "CREATE TABLE terms (\n" | ||
| " id integer,\n" | ||
| " title text,\n" | ||
| " content text,\n" | ||
| " tag varchar(256)\n" | ||
| ");" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "CREATE INDEX pgroonga_terms_index\n" | ||
| " ON terms\n" | ||
| " USING pgroonga (title, content, tag);" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "INSERT INTO terms\n" | ||
| " VALUES (1,\n" | ||
| " 'PostgreSQL',\n" | ||
| " 'PostgreSQLはリレーショナル・データベース管理システムです。',\n" | ||
| " 'PostgreSQL');\n" | ||
| "INSERT INTO terms\n" | ||
| " VALUES (2,\n" | ||
| " 'Groonga',\n" | ||
| " 'Groongaは日本語対応の高速な全文検索エンジンです。',\n" | ||
| " 'Groonga');\n" | ||
| "INSERT INTO terms\n" | ||
| " VALUES (3,\n" | ||
| " 'PGroonga',\n" | ||
| " 'PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。',\n" | ||
| " 'PostgreSQL');\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "You can use [`match_columns` option](http://groonga.org/docs/reference/command" | ||
| "s/select.html#select-match-columns) to use weight:" | ||
| msgstr "" | ||
| "[`match_columns`オプション](http://groonga.org/ja/docs/reference/commands/select.ht" | ||
| "ml#select-match-columns)を使うと重みを使えます。" | ||
|
|
||
| msgid "" | ||
| "```sql\n" | ||
| "SELECT *\n" | ||
| " FROM json_array_elements(\n" | ||
| " pgroonga.command('select ' ||\n" | ||
| " pgroonga.table_name('pgroonga_terms_index') || ' ' |" | ||
| "|\n" | ||
| " '--match_columns \"title * 10 || content\" ' ||\n" | ||
| " '--query \"Groonga OR PostgreSQL OR 全文検索\" ' ||\n" | ||
| " '--output_columns \"_score, title, content\" ' ||\n" | ||
| " '--sortby \"-_score\"'\n" | ||
| " )::json->1->0);\n" | ||
| "-- value " | ||
| " \n" | ||
| "-- ---------------------------------------------------------------------------" | ||
| "-----------------\n" | ||
| "-- [3]\n" | ||
| "-- [[\"_score\",\"Int32\"],[\"title\",\"LongText\"],[\"content\",\"LongText\"]]\n" | ||
| "-- [12,\"Groonga\",\"Groongaは日本語対応の高速な全文検索エンジンです。\"]\n" | ||
| "-- [11,\"PostgreSQL\",\"PostgreSQLはリレーショナル・データベース管理システムです。\"]\n" | ||
| "-- [2,\"PGroonga\",\"PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。\"]\n" | ||
| "-- (5 rows)\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "You can use drilldown feature by [`drilldown` option](http://groonga.org/docs/" | ||
| "reference/commands/select.html#select-drilldown):" | ||
| msgstr "" | ||
| "[`drilldown`オプション](http://groonga.org/ja/docs/reference/commands/select.html#s" | ||
| "elect-drilldown)を使うとドリルダウン機能を使えます。" | ||
|
|
||
| msgid "" | ||
| "```sql\n" | ||
| "SELECT *\n" | ||
| " FROM json_array_elements(\n" | ||
| " pgroonga.command('select ' ||\n" | ||
| " pgroonga.table_name('pgroonga_terms_index') || ' ' |" | ||
| "|\n" | ||
| " '--match_columns \"title * 10 || content\" ' ||\n" | ||
| " '--query \"Groonga OR PostgreSQL OR 全文検索\" ' ||\n" | ||
| " '--output_columns \"_score, title\" ' ||\n" | ||
| " '--sortby \"-_score\" ' ||\n" | ||
| " '--drilldown \"tag\"'\n" | ||
| " )::json->1);\n" | ||
| "-- value " | ||
| " \n" | ||
| "-- ---------------------------------------------------------------------------" | ||
| "----------------------\n" | ||
| "-- [[3],[[\"_score\",\"Int32\"],[\"title\",\"LongText\"]],[12,\"Groonga\"],[11,\"Postgre" | ||
| "SQL\"],[2,\"PGroonga\"]]\n" | ||
| "-- [[2],[[\"_key\",\"ShortText\"],[\"_nsubrecs\",\"Int32\"]],[\"Groonga\",1],[\"PostgreS" | ||
| "QL\",2]]\n" | ||
| "-- (2 rows)\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "`select` Groonga command may help you when `SELECT` statement in SQL is slow." | ||
| msgstr "Groongaの`select`コマンドはSQLの`SELECT`分が遅いときの手段として使えます。" | ||
|
|
||
| msgid "## See also" | ||
| msgstr "## 参考" | ||
|
|
||
| msgid "" | ||
| " * [`pgroonga.table_name` function description in tutorial](../../tutorial/#p" | ||
| "groonga-table-name)\n" | ||
| " * [Attention when you use `select` Groonga command](pgroonga-command.html#at" | ||
| "tention)" | ||
| msgstr "" | ||
| " * [チュートリアルの`pgroonga.table_name`関数の説明](../../tutorial/#pgroonga-table-name)\n" | ||
| " * [Groongaの`select`コマンドを使う時の注意](pgroonga-command.html#attention)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| --- | ||
| title: pgroonga.table_name関数 | ||
| layout: ja | ||
| --- | ||
|
|
||
| # `pgroonga.table_name`関数 | ||
|
|
||
| ## 概要 | ||
|
|
||
| `pgroonga.table_name`関数はPGroongaのインデックス名をGroongaのテーブル名に変換します。Groongaのテーブル名は[`pgroonga.command`関数](pgroonga-command.html)で[Groongaの`select`コマンド](http://groonga.org/ja/docs/reference/commands/select.html)を使うときに便利です。 | ||
|
|
||
| Groongaの`select`コマンドを使うと重み機能を使えます。 | ||
|
|
||
| ## 構文 | ||
|
|
||
| この関数の構文は次の通りです。 | ||
|
|
||
| ```text | ||
| text pgroonga.table_name(pgroonga_index_name) | ||
| ``` | ||
|
|
||
| `pgroonga_index_name`は`text`型の値です。このインデックス名をGroongaのテーブル名に指定します。このインデックスは`USING pgroonga`で作ったインデックスでなければいけません。 | ||
|
|
||
| `pgroonga.table_name`は`pgroonga_index_name`に対応するGroongaのテーブル名を`text`型の値として返します。もし、`pgroonga_index_name`が存在していない、または、PGroongaのインデックスでない場合は、`pgroonga.table_name`はエラーにします。 | ||
|
|
||
| ## 使い方 | ||
|
|
||
| 以下はサンプルのスキーマとデータです。このスキーマでは、検索対象のデータと出力対象のデータはどちらもインデックス対象のカラムです。 | ||
|
|
||
| ```sql | ||
| CREATE TABLE terms ( | ||
| id integer, | ||
| title text, | ||
| content text, | ||
| tag varchar(256) | ||
| ); | ||
|
|
||
| CREATE INDEX pgroonga_terms_index | ||
| ON terms | ||
| USING pgroonga (title, content, tag); | ||
|
|
||
| INSERT INTO terms | ||
| VALUES (1, | ||
| 'PostgreSQL', | ||
| 'PostgreSQLはリレーショナル・データベース管理システムです。', | ||
| 'PostgreSQL'); | ||
| INSERT INTO terms | ||
| VALUES (2, | ||
| 'Groonga', | ||
| 'Groongaは日本語対応の高速な全文検索エンジンです。', | ||
| 'Groonga'); | ||
| INSERT INTO terms | ||
| VALUES (3, | ||
| 'PGroonga', | ||
| 'PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。', | ||
| 'PostgreSQL'); | ||
| ``` | ||
|
|
||
| [`match_columns`オプション](http://groonga.org/ja/docs/reference/commands/select.html#select-match-columns)を使うと重みを使えます。 | ||
|
|
||
| ```sql | ||
| SELECT * | ||
| FROM json_array_elements( | ||
| pgroonga.command('select ' || | ||
| pgroonga.table_name('pgroonga_terms_index') || ' ' || | ||
| '--match_columns "title * 10 || content" ' || | ||
| '--query "Groonga OR PostgreSQL OR 全文検索" ' || | ||
| '--output_columns "_score, title, content" ' || | ||
| '--sortby "-_score"' | ||
| )::json->1->0); | ||
| -- value | ||
| -- -------------------------------------------------------------------------------------------- | ||
| -- [3] | ||
| -- [["_score","Int32"],["title","LongText"],["content","LongText"]] | ||
| -- [12,"Groonga","Groongaは日本語対応の高速な全文検索エンジンです。"] | ||
| -- [11,"PostgreSQL","PostgreSQLはリレーショナル・データベース管理システムです。"] | ||
| -- [2,"PGroonga","PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。"] | ||
| -- (5 rows) | ||
| ``` | ||
|
|
||
| [`drilldown`オプション](http://groonga.org/ja/docs/reference/commands/select.html#select-drilldown)を使うとドリルダウン機能を使えます。 | ||
|
|
||
| ```sql | ||
| SELECT * | ||
| FROM json_array_elements( | ||
| pgroonga.command('select ' || | ||
| pgroonga.table_name('pgroonga_terms_index') || ' ' || | ||
| '--match_columns "title * 10 || content" ' || | ||
| '--query "Groonga OR PostgreSQL OR 全文検索" ' || | ||
| '--output_columns "_score, title" ' || | ||
| '--sortby "-_score" ' || | ||
| '--drilldown "tag"' | ||
| )::json->1); | ||
| -- value | ||
| -- ------------------------------------------------------------------------------------------------- | ||
| -- [[3],[["_score","Int32"],["title","LongText"]],[12,"Groonga"],[11,"PostgreSQL"],[2,"PGroonga"]] | ||
| -- [[2],[["_key","ShortText"],["_nsubrecs","Int32"]],["Groonga",1],["PostgreSQL",2]] | ||
| -- (2 rows) | ||
| ``` | ||
|
|
||
| Groongaの`select`コマンドはSQLの`SELECT`分が遅いときの手段として使えます。 | ||
|
|
||
| ## 参考 | ||
|
|
||
| * [チュートリアルの`pgroonga.table_name`関数の説明](../../tutorial/#pgroonga-table-name) | ||
| * [Groongaの`select`コマンドを使う時の注意](pgroonga-command.html#attention) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters