Kouhei Sutou
null+****@clear*****
Wed Aug 16 21:21:55 JST 2017
Kouhei Sutou 2017-08-16 21:21:55 +0900 (Wed, 16 Aug 2017) New Revision: 2dbd02d43198f58d34ba37b1b9d71373f00c07d1 https://github.com/pgroonga/pgroonga.github.io/commit/2dbd02d43198f58d34ba37b1b9d71373f00c07d1 Message: Use pgroonga_ in tutorial Modified files: _po/ja/tutorial/index.po ja/tutorial/index.md tutorial/index.md Modified: _po/ja/tutorial/index.po (+50 -50) =================================================================== --- _po/ja/tutorial/index.po 2017-08-16 21:17:32 +0900 (98bb250) +++ _po/ja/tutorial/index.po 2017-08-16 21:21:55 +0900 (480edee) @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2017-08-16 21:15+0900\n" +"PO-Revision-Date: 2017-08-16 21:20+0900\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -307,19 +307,19 @@ msgid "### Score {#score}" msgstr "### スコアー {#score}" msgid "" -"You can use `pgroonga.score` function to get precision as a number. If a recor" +"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`関数を使うとマッチした度合いを数値で取得することができます。検索したクエリーに対してよりマッチしているレコードほど高い数値に" +"`pgroonga_score`関数を使うとマッチした度合いを数値で取得することができます。検索したクエリーに対してよりマッチしているレコードほど高い数値に" "なります。" msgid "" -"You need to add primary key column into `pgroonga` index to use `pgroonga.scor" +"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`." +"nga_score` function always returns `0`." msgstr "" -"`pgroonga.score`関数を使うためにはプライマリーキーカラムを`pgroonga`インデックスに入れる必要があります。もし、プライマリーキーカラ" -"ムが`pgroonga`インデックスに入っていない場合は、`pgroonga.score`関数は常に`0`を返します。" +"`pgroonga_score`関数を使うためにはプライマリーキーカラムを`pgroonga`インデックスに入れる必要があります。もし、プライマリーキーカラ" +"ムが`pgroonga`インデックスに入っていない場合は、`pgroonga_score`関数は常に`0`を返します。" msgid "Here is a sample schema that includes primary key into indexed columns:" msgstr "以下はインデックス対象のカラムにプライマリーキーが入っているスキーマの例です。" @@ -363,7 +363,7 @@ msgstr "全文検索を実行してスコアーを取得します。" msgid "" "```sql\n" -"SELECT *, pgroonga.score(score_memos)\n" +"SELECT *, pgroonga_score(score_memos) AS score\n" " FROM score_memos\n" " WHERE content &@ 'PGroonga' OR content &@ 'PostgreSQL';\n" "-- id | content | scor" @@ -378,7 +378,7 @@ msgid "" "```" msgstr "" "```sql\n" -"SELECT *, pgroonga.score(score_memos)\n" +"SELECT *, pgroonga_score(score_memos) AS score\n" " FROM score_memos\n" " WHERE content &@ 'PGroonga' OR content &@ 'PostgreSQL';\n" "-- id | content " @@ -391,16 +391,16 @@ msgstr "" "```" msgid "" -"You can sort matched records by precision ascending by using `pgroonga.score` " +"You can sort matched records by precision ascending by using `pgroonga_score` " "function in `ORDER BY` clause:" -msgstr "`ORDER BY`節で`pgroonga.score`関数を使うことでスコアー順にマッチしたレコードをソートできます。" +msgstr "`ORDER BY`節で`pgroonga_score`関数を使うことでスコアー順にマッチしたレコードをソートできます。" msgid "" "```sql\n" -"SELECT *, pgroonga.score(score_memos)\n" +"SELECT *, pgroonga_score(score_memos) AS score\n" " FROM score_memos\n" " WHERE content &@ 'PGroonga' OR content &@ 'PostgreSQL'\n" -" ORDER BY pgroonga.score(score_memos) DESC;\n" +" ORDER BY pgroonga_score(score_memos) DESC;\n" "-- id | content | scor" "e \n" "-- ----+----------------------------------------------------------------+-----" @@ -413,10 +413,10 @@ msgid "" "```" msgstr "" "```sql\n" -"SELECT *, pgroonga.score(score_memos)\n" +"SELECT *, pgroonga_score(score_memos) AS score\n" " FROM score_memos\n" " WHERE content &@ 'PGroonga' OR content &@ 'PostgreSQL'\n" -" ORDER BY pgroonga.score(score_memos) DESC;\n" +" ORDER BY pgroonga_score(score_memos) DESC;\n" "-- id | content " " | score \n" "-- ----+----------------------------------------------------------------------" @@ -427,10 +427,10 @@ msgstr "" "```" msgid "" -"See [`pgroonga.score` function](../reference/functions/pgroonga-score.html) fo" +"See [`pgroonga_score` function](../reference/functions/pgroonga-score.html) fo" "r more details such as how to compute precision." msgstr "" -"マッチした度合いの計算方法など詳細は[`pgroonga.score`関数](../reference/functions/pgroonga-score.h" +"マッチした度合いの計算方法など詳細は[`pgroonga_score`関数](../reference/functions/pgroonga-score.h" "tml)を参照してください。" msgid "### Highlight {#highlight}" @@ -440,22 +440,22 @@ msgid "TODO" msgstr "" msgid "" -"See [`pgroonga.highlight_html` function](../reference/functions/pgroonga-highl" +"See [`pgroonga_highlight_html` function](../reference/functions/pgroonga-highl" "ight-html.html) for more details." msgstr "" -"詳細は[`pgroonga.highlight_html`関数](../reference/functions/pgroonga-highlight-htm" +"詳細は[`pgroonga_highlight_html`関数](../reference/functions/pgroonga-highlight-htm" "l.html)を参照してください。" msgid "### Snippet (KWIC, keyword in context) {#snippet}" msgstr "### スニペット(KWIC、keyword in context) {#snippet}" msgid "" -"You can use `pgroonga.snippet_html` function to get texts around keywords from" +"You can use `pgroonga_snippet_html` function to get texts around keywords from" " search target text. It's also known as [KWIC](https://en.wikipedia.org/wiki/K" "ey_Word_in_Context) (keyword in context). You can see it in search result on W" "eb search engine." msgstr "" -"`pgroonga.snippet_html`関数を使うと検索対象のテキストからキーワード周辺のテキストを抽出できます。この処理を[KWIC](https:" +"`pgroonga_snippet_html`関数を使うと検索対象のテキストからキーワード周辺のテキストを抽出できます。この処理を[KWIC](https:" "//ja.wikipedia.org/wiki/KWIC)(keyword in context)とも言います。Webの検索エンジンの検索結果でみたことがあ" "る人も多いでしょう。" @@ -471,20 +471,20 @@ msgid "" msgstr "" msgid "" -"There are some `fast` keywords. `pgroonga.snippet_html` extracts texts around " +"There are some `fast` keywords. `pgroonga_snippet_html` extracts texts around " "`fast`. Keywords in extracted texts are surround with `<span class=\"keyword\">`" " and `</span>`." msgstr "" -"この中には`fast`というキーワードがいくつか出現しています。`pgroonga.snippet_html`は`fast`周辺のテキストを抽出します。抽出" +"この中には`fast`というキーワードがいくつか出現しています。`pgroonga_snippet_html`は`fast`周辺のテキストを抽出します。抽出" "されたテキスト内のキーワードは`<span class=\"keyword\">`と`</span>`で囲まれています。" msgid "" -"`html` in `pgroonga.snippet_html` means that this function returns result for " +"`html` in `pgroonga_snippet_html` means that this function returns result for " "HTML output." -msgstr "`pgroonga.snippet_html`という関数名の中の`html`は、この関数はHTML出力用の結果を返す、という意味です。" +msgstr "`pgroonga_snippet_html`という関数名の中の`html`は、この関数はHTML出力用の結果を返す、という意味です。" -msgid "Here is the result of `pgroonga.snippet_html` against the above text:" -msgstr "上述のテキストに対して`pgroonga.snippet_html`を実行した結果は次の通りです。" +msgid "Here is the result of `pgroonga_snippet_html` against the above text:" +msgstr "上述のテキストに対して`pgroonga_snippet_html`を実行した結果は次の通りです。" msgid "" "> Groonga is a <span class=\"keyword\">fast</span> and accurate full text search" @@ -509,7 +509,7 @@ msgstr "" msgid "" "```sql\n" -"SELECT unnest(pgroonga.snippet_html(\n" +"SELECT unnest(pgroonga_snippet_html(\n" " 'Groonga is a fast and accurate full text search engine based on ' ||\n" " 'inverted index. One of the characteristics of Groonga is that a ' ||\n" " 'newly registered document instantly appears in search results. ' ||\n" @@ -545,20 +545,20 @@ msgid "" msgstr "" msgid "" -"See [`pgroonga.snippet_html` function](../reference/functions/pgroonga-snippet" +"See [`pgroonga_snippet_html` function](../reference/functions/pgroonga-snippet" "-html.html) for more details." msgstr "" -"詳細は[`pgroonga.snippet_html`関数](../reference/functions/pgroonga-snippet-html.ht" +"詳細は[`pgroonga_snippet_html`関数](../reference/functions/pgroonga-snippet-html.ht" "ml)を参照してください。" msgid "### Synonym {#synonym}" msgstr "### 同義語 {#synonym}" msgid "" -"See [`pgroonga.query_expand` function](../reference/functions/pgroonga-query-e" +"See [`pgroonga_query_expand` function](../reference/functions/pgroonga-query-e" "xpand.html) for more details." msgstr "" -"詳細は[`pgroonga.query_expand`関数](../reference/functions/pgroonga-query-expand.ht" +"詳細は[`pgroonga_query_expand`関数](../reference/functions/pgroonga-query-expand.ht" "ml)を参照してください。" msgid "## Regular expression {#regular-expression}" @@ -1191,15 +1191,15 @@ msgstr "" "GroongaそのものはSQLのインターフェイスを提供していません。これはPostgreSQLユーザーには使いづらいです。しかし、PGroongaはSQL経" "由でGroongaを使う機能を提供しています。" -msgid "### `pgroonga.command` function" -msgstr "### `pgroonga.command`関数" +msgid "### `pgroonga_command` function" +msgstr "### `pgroonga_command`関数" msgid "" "You can execute [Groonga commands](http://groonga.org/docs/reference/command.h" -"tml) and get the result of the execution as string by `pgroonga.command` funct" +"tml) and get the result of the execution as string by `pgroonga_command` funct" "ion." msgstr "" -"`pgroonga.command`関数を使うと[Groongaのコマンド](http://groonga.org/ja/docs/reference/co" +"`pgroonga_command`関数を使うと[Groongaのコマンド](http://groonga.org/ja/docs/reference/co" "mmand.html)を実行し、その結果を文字列で取得できます。" msgid "" @@ -1211,7 +1211,7 @@ msgstr "" msgid "" "```sql\n" -"SELECT pgroonga.command('status');\n" +"SELECT pgroonga_command('status') AS command;\n" "-- command " " " " \n" @@ -1241,7 +1241,7 @@ msgstr "以下は`status`コマンドの結果のキーと値のペアそれぞ msgid "" "```sql\n" -"SELECT * FROM json_each(pgroonga.command('status')::json->1);\n" +"SELECT * FROM json_each(pgroonga_command('status')::json->1);\n" "-- key | value \n" "-- -------------------------+--------------------\n" "-- alloc_count | 168\n" @@ -1258,14 +1258,14 @@ msgid "" msgstr "" msgid "" -"See [`pgroonga.command` function](../reference/functions/pgroonga-command.html" +"See [`pgroonga_command` function](../reference/functions/pgroonga-command.html" ") for more details." msgstr "" -"詳細は[`pgroonga.command`関数](../reference/functions/pgroonga-command.html)を参照してくだ" +"詳細は[`pgroonga_command`関数](../reference/functions/pgroonga-command.html)を参照してくだ" "さい。" -msgid "### `pgroonga.table_name` function {#pgroonga-table-name}" -msgstr "### `pgroonga.table_name`関数 {#pgroonga-table-name}" +msgid "### `pgroonga_table_name` function {#pgroonga-table-name}" +msgstr "### `pgroonga_table_name`関数 {#pgroonga-table-name}" msgid "" "PGroonga stores values of index target columns. You can use these values to se" @@ -1276,21 +1276,21 @@ msgstr "" "g/ja/docs/reference/commands/select.html)で検索・出力するために使うことができます。" msgid "" -"`select` Groonga command needs table name. You can use `pgroonga.table_name` f" +"`select` Groonga command needs table name. You can use `pgroonga_table_name` f" "unction to convert index name in PostgreSQL to table name in Groonga." msgstr "" -"Groongaの`select`コマンドを使うにはテーブル名が必要です。`pgroonga.table_name`関数を使うとPostgreSQLでのインデ" +"Groongaの`select`コマンドを使うにはテーブル名が必要です。`pgroonga_table_name`関数を使うとPostgreSQLでのインデ" "ックス名をGroongaでのテーブル名に変換できます。" msgid "" -"Here is an example to use `select` command with `pgroonga.table_name` function" +"Here is an example to use `select` command with `pgroonga_table_name` function" ":" -msgstr "以下は`pgroonga.table_name`関数を使って`select`コマンドを実行する例です。" +msgstr "以下は`pgroonga_table_name`関数を使って`select`コマンドを実行する例です。" msgid "" "```sql\n" "SELECT *\n" -" FROM json_array_elements(pgroonga.command('select ' || pgroonga.table_name('" +" FROM json_array_elements(pgroonga_command('select ' || pgroonga_table_name('" "pgroonga_content_index'))::json->1->0);\n" "-- value " " \n" @@ -1308,7 +1308,7 @@ msgid "" msgstr "" "```sql\n" "SELECT *\n" -" FROM json_array_elements(pgroonga.command('select ' || pgroonga.table_name('" +" FROM json_array_elements(pgroonga_command('select ' || pgroonga_table_name('" "pgroonga_content_index'))::json->1->0);\n" "-- value " " \n" @@ -1324,10 +1324,10 @@ msgstr "" "```" msgid "" -"See [`pgroonga.table_name` function](../reference/functions/pgroonga-table-nam" +"See [`pgroonga_table_name` function](../reference/functions/pgroonga-table-nam" "e.html) for more details." msgstr "" -"詳細は[`pgroonga.table_name`関数](../reference/functions/pgroonga-table-name.html)を" +"詳細は[`pgroonga_table_name`関数](../reference/functions/pgroonga-table-name.html)を" "参照してください。" msgid "## Next step" Modified: ja/tutorial/index.md (+25 -25) =================================================================== --- ja/tutorial/index.md 2017-08-16 21:17:32 +0900 (6b53b2b) +++ ja/tutorial/index.md 2017-08-16 21:21:55 +0900 (7c00114) @@ -144,9 +144,9 @@ SELECT * FROM memos WHERE content LIKE '%全文検索%'; ### スコアー {#score} -`pgroonga.score`関数を使うとマッチした度合いを数値で取得することができます。検索したクエリーに対してよりマッチしているレコードほど高い数値になります。 +`pgroonga_score`関数を使うとマッチした度合いを数値で取得することができます。検索したクエリーに対してよりマッチしているレコードほど高い数値になります。 -`pgroonga.score`関数を使うためにはプライマリーキーカラムを`pgroonga`インデックスに入れる必要があります。もし、プライマリーキーカラムが`pgroonga`インデックスに入っていない場合は、`pgroonga.score`関数は常に`0`を返します。 +`pgroonga_score`関数を使うためにはプライマリーキーカラムを`pgroonga`インデックスに入れる必要があります。もし、プライマリーキーカラムが`pgroonga`インデックスに入っていない場合は、`pgroonga_score`関数は常に`0`を返します。 以下はインデックス対象のカラムにプライマリーキーが入っているスキーマの例です。 @@ -179,7 +179,7 @@ SET enable_seqscan = off; 全文検索を実行してスコアーを取得します。 ```sql -SELECT *, pgroonga.score(score_memos) +SELECT *, pgroonga_score(score_memos) AS score FROM score_memos WHERE content &@ 'PGroonga' OR content &@ 'PostgreSQL'; -- id | content | score @@ -189,13 +189,13 @@ SELECT *, pgroonga.score(score_memos) -- (2 rows) ``` -`ORDER BY`節で`pgroonga.score`関数を使うことでスコアー順にマッチしたレコードをソートできます。 +`ORDER BY`節で`pgroonga_score`関数を使うことでスコアー順にマッチしたレコードをソートできます。 ```sql -SELECT *, pgroonga.score(score_memos) +SELECT *, pgroonga_score(score_memos) AS score FROM score_memos WHERE content &@ 'PGroonga' OR content &@ 'PostgreSQL' - ORDER BY pgroonga.score(score_memos) DESC; + ORDER BY pgroonga_score(score_memos) DESC; -- id | content | score -- ----+---------------------------------------------------------------------------+------- -- 3 | PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。 | 2 @@ -203,28 +203,28 @@ SELECT *, pgroonga.score(score_memos) -- (2 rows) ``` -マッチした度合いの計算方法など詳細は[`pgroonga.score`関数](../reference/functions/pgroonga-score.html)を参照してください。 +マッチした度合いの計算方法など詳細は[`pgroonga_score`関数](../reference/functions/pgroonga-score.html)を参照してください。 ### ハイライト {#highlight} TODO -詳細は[`pgroonga.highlight_html`関数](../reference/functions/pgroonga-highlight-html.html)を参照してください。 +詳細は[`pgroonga_highlight_html`関数](../reference/functions/pgroonga-highlight-html.html)を参照してください。 ### スニペット(KWIC、keyword in context) {#snippet} -`pgroonga.snippet_html`関数を使うと検索対象のテキストからキーワード周辺のテキストを抽出できます。この処理を[KWIC](https://ja.wikipedia.org/wiki/KWIC)(keyword in context)とも言います。Webの検索エンジンの検索結果でみたことがある人も多いでしょう。 +`pgroonga_snippet_html`関数を使うと検索対象のテキストからキーワード周辺のテキストを抽出できます。この処理を[KWIC](https://ja.wikipedia.org/wiki/KWIC)(keyword in context)とも言います。Webの検索エンジンの検索結果でみたことがある人も多いでしょう。 説明用のサンプルテキストは次の通りです。なお、これはGroongaの説明文です。 > Groonga is a fast and accurate full text search engine based on inverted index. One of the characteristics of Groonga is that a newly registered document instantly appears in search results. Also, Groonga allows updates without read locks. These characteristics result in superior performance on real-time applications. -この中には`fast`というキーワードがいくつか出現しています。`pgroonga.snippet_html`は`fast`周辺のテキストを抽出します。抽出されたテキスト内のキーワードは`<span class="keyword">`と`</span>`で囲まれています。 +この中には`fast`というキーワードがいくつか出現しています。`pgroonga_snippet_html`は`fast`周辺のテキストを抽出します。抽出されたテキスト内のキーワードは`<span class="keyword">`と`</span>`で囲まれています。 -`pgroonga.snippet_html`という関数名の中の`html`は、この関数はHTML出力用の結果を返す、という意味です。 +`pgroonga_snippet_html`という関数名の中の`html`は、この関数はHTML出力用の結果を返す、という意味です。 -上述のテキストに対して`pgroonga.snippet_html`を実行した結果は次の通りです。 +上述のテキストに対して`pgroonga_snippet_html`を実行した結果は次の通りです。 > Groonga is a <span class="keyword">fast</span> and accurate full text search engine based on inverted index. One of the characteristics of Groonga is that a newly registered document instantly appears in search results. Also, Gro @@ -233,7 +233,7 @@ TODO この挙動を説明するサンプルSQLは次の通りです。`FROM`がない次の`SELECT`でもこの関数を使えます。[`unnest`]({{ site.postgresql_doc_base_url.ja }}/functions-array.html)は配列を列に変換するPostgreSQLの関数であることに注意してください。 ```sql -SELECT unnest(pgroonga.snippet_html( +SELECT unnest(pgroonga_snippet_html( 'Groonga is a fast and accurate full text search engine based on ' || 'inverted index. One of the characteristics of Groonga is that a ' || 'newly registered document instantly appears in search results. ' || @@ -254,13 +254,13 @@ SELECT unnest(pgroonga.snippet_html( -- (2 rows) ``` -詳細は[`pgroonga.snippet_html`関数](../reference/functions/pgroonga-snippet-html.html)を参照してください。 +詳細は[`pgroonga_snippet_html`関数](../reference/functions/pgroonga-snippet-html.html)を参照してください。 ### 同義語 {#synonym} TODO -詳細は[`pgroonga.query_expand`関数](../reference/functions/pgroonga-query-expand.html)を参照してください。 +詳細は[`pgroonga_query_expand`関数](../reference/functions/pgroonga-query-expand.html)を参照してください。 ## 正規表現 {#regular-expression} @@ -685,14 +685,14 @@ TODO GroongaそのものはSQLのインターフェイスを提供していません。これはPostgreSQLユーザーには使いづらいです。しかし、PGroongaはSQL経由でGroongaを使う機能を提供しています。 -### `pgroonga.command`関数 +### `pgroonga_command`関数 -`pgroonga.command`関数を使うと[Groongaのコマンド](http://groonga.org/ja/docs/reference/command.html)を実行し、その結果を文字列で取得できます。 +`pgroonga_command`関数を使うと[Groongaのコマンド](http://groonga.org/ja/docs/reference/command.html)を実行し、その結果を文字列で取得できます。 以下は[`status`コマンド](http://groonga.org/ja/docs/reference/commands/status.html)を実行する例です。 ```sql -SELECT pgroonga.command('status'); +SELECT pgroonga_command('status') AS command; -- command -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- [[0,1423911561.69344,6.15119934082031e-05],{"alloc_count":164,"starttime":1423911561,"uptime":0,"version":"5.0.0-6-g17847c9","n_queries":0,"cache_hit_rate":0.0,"command_version":1,"default_command_version":1,"max_command_version":2}] @@ -704,7 +704,7 @@ Groongaから返ってくる結果はJSONです。Groongaから返ってくる 以下は`status`コマンドの結果のキーと値のペアそれぞれを列に変換する例です。 ```sql -SELECT * FROM json_each(pgroonga.command('status')::json->1); +SELECT * FROM json_each(pgroonga_command('status')::json->1); -- key | value -- -------------------------+-------------------- -- alloc_count | 168 @@ -719,19 +719,19 @@ SELECT * FROM json_each(pgroonga.command('status')::json->1); -- (9 rows) ``` -詳細は[`pgroonga.command`関数](../reference/functions/pgroonga-command.html)を参照してください。 +詳細は[`pgroonga_command`関数](../reference/functions/pgroonga-command.html)を参照してください。 -### `pgroonga.table_name`関数 {#pgroonga-table-name} +### `pgroonga_table_name`関数 {#pgroonga-table-name} PGroongaはインデックス対象のカラムの値を保存しています。これらの値を[Groongaの`select`コマンド](http://groonga.org/ja/docs/reference/commands/select.html)で検索・出力するために使うことができます。 -Groongaの`select`コマンドを使うにはテーブル名が必要です。`pgroonga.table_name`関数を使うとPostgreSQLでのインデックス名をGroongaでのテーブル名に変換できます。 +Groongaの`select`コマンドを使うにはテーブル名が必要です。`pgroonga_table_name`関数を使うとPostgreSQLでのインデックス名をGroongaでのテーブル名に変換できます。 -以下は`pgroonga.table_name`関数を使って`select`コマンドを実行する例です。 +以下は`pgroonga_table_name`関数を使って`select`コマンドを実行する例です。 ```sql SELECT * - FROM json_array_elements(pgroonga.command('select ' || pgroonga.table_name('pgroonga_content_index'))::json->1->0); + FROM json_array_elements(pgroonga_command('select ' || pgroonga_table_name('pgroonga_content_index'))::json->1->0); -- value -- ----------------------------------------------------------------------------------- -- [4] @@ -743,7 +743,7 @@ SELECT * -- (6 rows) ``` -詳細は[`pgroonga.table_name`関数](../reference/functions/pgroonga-table-name.html)を参照してください。 +詳細は[`pgroonga_table_name`関数](../reference/functions/pgroonga-table-name.html)を参照してください。 ## 次のステップ Modified: tutorial/index.md (+25 -25) =================================================================== --- tutorial/index.md 2017-08-16 21:17:32 +0900 (a5533b7) +++ tutorial/index.md 2017-08-16 21:21:55 +0900 (bc95bd0) @@ -144,9 +144,9 @@ You can also use `ILIKE` operator like `LIKE` operator. ### 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. +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. -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`. +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`. Here is a sample schema that includes primary key into indexed columns: @@ -179,7 +179,7 @@ SET enable_seqscan = off; Perform full text search and get score. ```sql -SELECT *, pgroonga.score(score_memos) +SELECT *, pgroonga_score(score_memos) AS score FROM score_memos WHERE content &@ 'PGroonga' OR content &@ 'PostgreSQL'; -- id | content | score @@ -189,13 +189,13 @@ SELECT *, pgroonga.score(score_memos) -- (2 rows) ``` -You can sort matched records by precision ascending by using `pgroonga.score` function in `ORDER BY` clause: +You can sort matched records by precision ascending by using `pgroonga_score` function in `ORDER BY` clause: ```sql -SELECT *, pgroonga.score(score_memos) +SELECT *, pgroonga_score(score_memos) AS score FROM score_memos WHERE content &@ 'PGroonga' OR content &@ 'PostgreSQL' - ORDER BY pgroonga.score(score_memos) DESC; + ORDER BY pgroonga_score(score_memos) DESC; -- id | content | score -- ----+----------------------------------------------------------------+------- -- 3 | PGroonga is a PostgreSQL extension that uses Groonga as index. | 2 @@ -203,28 +203,28 @@ SELECT *, pgroonga.score(score_memos) -- (2 rows) ``` -See [`pgroonga.score` function](../reference/functions/pgroonga-score.html) for more details such as how to compute precision. +See [`pgroonga_score` function](../reference/functions/pgroonga-score.html) for more details such as how to compute precision. ### Highlight {#highlight} TODO -See [`pgroonga.highlight_html` function](../reference/functions/pgroonga-highlight-html.html) for more details. +See [`pgroonga_highlight_html` function](../reference/functions/pgroonga-highlight-html.html) for more details. ### Snippet (KWIC, keyword in context) {#snippet} -You can use `pgroonga.snippet_html` function to get texts around keywords from search target text. It's also known as [KWIC](https://en.wikipedia.org/wiki/Key_Word_in_Context) (keyword in context). You can see it in search result on Web search engine. +You can use `pgroonga_snippet_html` function to get texts around keywords from search target text. It's also known as [KWIC](https://en.wikipedia.org/wiki/Key_Word_in_Context) (keyword in context). You can see it in search result on Web search engine. Here is a sample text for description. It's a description about Groonga. > Groonga is a fast and accurate full text search engine based on inverted index. One of the characteristics of Groonga is that a newly registered document instantly appears in search results. Also, Groonga allows updates without read locks. These characteristics result in superior performance on real-time applications. -There are some `fast` keywords. `pgroonga.snippet_html` extracts texts around `fast`. Keywords in extracted texts are surround with `<span class="keyword">` and `</span>`. +There are some `fast` keywords. `pgroonga_snippet_html` extracts texts around `fast`. Keywords in extracted texts are surround with `<span class="keyword">` and `</span>`. -`html` in `pgroonga.snippet_html` means that this function returns result for HTML output. +`html` in `pgroonga_snippet_html` means that this function returns result for HTML output. -Here is the result of `pgroonga.snippet_html` against the above text: +Here is the result of `pgroonga_snippet_html` against the above text: > Groonga is a <span class="keyword">fast</span> and accurate full text search engine based on inverted index. One of the characteristics of Groonga is that a newly registered document instantly appears in search results. Also, Gro @@ -233,7 +233,7 @@ This function can be used for all texts. It's not only for search result by PGro Here is a sample SQL that describes about it. You can use the function in the following `SELECT` that doesn't have `FROM`. Note that [`unnest`]({{ site.postgresql_doc_base_url.en }}/functions-array.html) is a PostgreSQL function that converts an array to rows. ```sql -SELECT unnest(pgroonga.snippet_html( +SELECT unnest(pgroonga_snippet_html( 'Groonga is a fast and accurate full text search engine based on ' || 'inverted index. One of the characteristics of Groonga is that a ' || 'newly registered document instantly appears in search results. ' || @@ -254,13 +254,13 @@ SELECT unnest(pgroonga.snippet_html( -- (2 rows) ``` -See [`pgroonga.snippet_html` function](../reference/functions/pgroonga-snippet-html.html) for more details. +See [`pgroonga_snippet_html` function](../reference/functions/pgroonga-snippet-html.html) for more details. ### Synonym {#synonym} TODO -See [`pgroonga.query_expand` function](../reference/functions/pgroonga-query-expand.html) for more details. +See [`pgroonga_query_expand` function](../reference/functions/pgroonga-query-expand.html) for more details. ## Regular expression {#regular-expression} @@ -685,14 +685,14 @@ In another instance, Groonga can perform query that doesn't use all columns in r You can't use SQL to use Groonga directory. It's not PostgrSQL user friendly. But PGroonga provides a feature to use Groonga directly throw SQL. -### `pgroonga.command` function +### `pgroonga_command` function -You can execute [Groonga commands](http://groonga.org/docs/reference/command.html) and get the result of the execution as string by `pgroonga.command` function. +You can execute [Groonga commands](http://groonga.org/docs/reference/command.html) and get the result of the execution as string by `pgroonga_command` function. Here is an example that executes [`status` command](http://groonga.org/docs/reference/commands/status.html): ```sql -SELECT pgroonga.command('status'); +SELECT pgroonga_command('status') AS command; -- command -- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- [[0,1423911561.69344,6.15119934082031e-05],{"alloc_count":164,"starttime":1423911561,"uptime":0,"version":"5.0.0-6-g17847c9","n_queries":0,"cache_hit_rate":0.0,"command_version":1,"default_command_version":1,"max_command_version":2}] @@ -704,7 +704,7 @@ Result from Groonga is JSON. You can use JSON related functions provided by Post Here is an example to map one key value pair in the result of `status` command to one row: ```sql -SELECT * FROM json_each(pgroonga.command('status')::json->1); +SELECT * FROM json_each(pgroonga_command('status')::json->1); -- key | value -- -------------------------+-------------------- -- alloc_count | 168 @@ -719,19 +719,19 @@ SELECT * FROM json_each(pgroonga.command('status')::json->1); -- (9 rows) ``` -See [`pgroonga.command` function](../reference/functions/pgroonga-command.html) for more details. +See [`pgroonga_command` function](../reference/functions/pgroonga-command.html) for more details. -### `pgroonga.table_name` function {#pgroonga-table-name} +### `pgroonga_table_name` function {#pgroonga-table-name} PGroonga stores values of index target columns. You can use these values to search and output by [`select` Groonga command](http://groonga.org/docs/reference/commands/select.html). -`select` Groonga command needs table name. You can use `pgroonga.table_name` function to convert index name in PostgreSQL to table name in Groonga. +`select` Groonga command needs table name. You can use `pgroonga_table_name` function to convert index name in PostgreSQL to table name in Groonga. -Here is an example to use `select` command with `pgroonga.table_name` function: +Here is an example to use `select` command with `pgroonga_table_name` function: ```sql SELECT * - FROM json_array_elements(pgroonga.command('select ' || pgroonga.table_name('pgroonga_content_index'))::json->1->0); + FROM json_array_elements(pgroonga_command('select ' || pgroonga_table_name('pgroonga_content_index'))::json->1->0); -- value -- -------------------------------------------------------------------------------- -- [4] @@ -743,7 +743,7 @@ SELECT * -- (6 rows) ``` -See [`pgroonga.table_name` function](../reference/functions/pgroonga-table-name.html) for more details. +See [`pgroonga_table_name` function](../reference/functions/pgroonga-table-name.html) for more details. ## Next step -------------- next part -------------- HTML����������������������������...下载