Navigation Menu

Skip to content

Commit

Permalink
Use English for sample data
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 25, 2015
1 parent be5638f commit c4dfa9c
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 102 deletions.
120 changes: 78 additions & 42 deletions _po/ja/reference/functions/pgroonga-command.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-10-25 21:03+0900\n"
"PO-Revision-Date: 2015-10-25 21:49+0900\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -91,6 +91,34 @@ msgstr ""
msgid "The followings show this case by example."
msgstr "このケースを例で説明します。"

msgid "Here are sample schema and data for examples:"
msgstr "例に使うサンプルスキーマとデータは次の通りです。"

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

msgid ""
"CREATE INDEX pgroonga_posts_index\n"
" ON posts\n"
" USING pgroonga (id, title, content);"
msgstr ""

msgid ""
"INSERT INTO posts VALUES (1, 'PostgreSQL', 'PostgreSQL is a relational databas"
"e management system.');\n"
"INSERT INTO posts VALUES (2, 'Groonga', 'Groonga is a fast full text search en"
"gine that supports all languages.');\n"
"INSERT INTO posts VALUES (3, 'PGroonga', 'PGroonga is a PostgreSQL extension t"
"hat uses Groonga as index.');\n"
"```"
msgstr ""

msgid "Here is the result before updating. There are 3 records:"
msgstr "以下は更新前の結果です。3レコードあります。"

Expand All @@ -99,20 +127,22 @@ msgid ""
"SELECT *\n"
" FROM json_array_elements(\n"
" pgroonga.command('select ' ||\n"
" pgroonga.table_name('pgroonga_terms_index')\n"
" pgroonga.table_name('pgroonga_posts_index')\n"
" )::json->1->0);\n"
"-- value "
" \n"
"-- value "
" \n"
"-- ---------------------------------------------------------------------------"
"--------------------------------\n"
"----------------------\n"
"-- [3]\n"
"-- [[\"_id\",\"UInt32\"],[\"_key\",\"UInt64\"],[\"content\",\"LongText\"],[\"tag\",\"ShortTe"
"xt\"],[\"title\",\"LongText\"]]\n"
"-- [1,1,\"PostgreSQLはリレーショナル・データベース管理システムです。\",\"PostgreSQL\",\"PostgreSQL\"]\n"
"-- [2,2,\"Groongaは日本語対応の高速な全文検索エンジンです。\",\"Groonga\",\"Groonga\"]\n"
"-- [3,3,\"PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。\",\"PostgreSQL\",\"PGr"
"oonga\"]\n"
"-- (5 行)\n"
"-- [[\"_id\",\"UInt32\"],[\"content\",\"LongText\"],[\"ctid\",\"UInt64\"],[\"id\",\"Int32\"],"
"[\"title\",\"LongText\"]]\n"
"-- [1,\"PostgreSQL is a relational database management system.\",1,1,\"PostgreSQ"
"L\"]\n"
"-- [2,\"Groonga is a fast full text search engine that supports all languages."
"\",2,2,\"Groonga\"]\n"
"-- [3,\"PGroonga is a PostgreSQL extension that uses Groonga as index.\",3,3,\"P"
"Groonga\"]\n"
"-- (5 rows)\n"
"```"
msgstr ""

Expand All @@ -121,10 +151,10 @@ msgstr "1つのレコードを更新します。"

msgid ""
"```sql\n"
"UPDATE terms\n"
"UPDATE posts\n"
" SET title = 'Mroonga',\n"
" content = 'MroongaはGroongaをバックエンドにしたMySQLのストレージエンジンです。',\n"
" tag = 'MySQL'\n"
" content = 'Mroonga is a MySQL storage engine that uses Groonga as backe"
"nd.'\n"
" WHERE id = 3;\n"
"```"
msgstr ""
Expand All @@ -139,53 +169,59 @@ msgid ""
"SELECT *\n"
" FROM json_array_elements(\n"
" pgroonga.command('select ' ||\n"
" pgroonga.table_name('pgroonga_terms_index')\n"
" pgroonga.table_name('pgroonga_posts_index')\n"
" )::json->1->0);\n"
"-- value "
" \n"
"-- value "
" \n"
"-- ---------------------------------------------------------------------------"
"--------------------------------\n"
"----------------------\n"
"-- [4]\n"
"-- [[\"_id\",\"UInt32\"],[\"_key\",\"UInt64\"],[\"content\",\"LongText\"],[\"tag\",\"ShortTe"
"xt\"],[\"title\",\"LongText\"]]\n"
"-- [1,1,\"PostgreSQLはリレーショナル・データベース管理システムです。\",\"PostgreSQL\",\"PostgreSQL\"]\n"
"-- [2,2,\"Groongaは日本語対応の高速な全文検索エンジンです。\",\"Groonga\",\"Groonga\"]\n"
"-- [3,3,\"PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。\",\"PostgreSQL\",\"PGr"
"oonga\"]\n"
"-- [4,4,\"MroongaはGroongaをバックエンドにしたMySQLのストレージエンジンです。\",\"MySQL\",\"Mroonga\"]\n"
"-- (6 行)\n"
"-- [[\"_id\",\"UInt32\"],[\"content\",\"LongText\"],[\"ctid\",\"UInt64\"],[\"id\",\"Int32\"],"
"[\"title\",\"LongText\"]]\n"
"-- [1,\"PostgreSQL is a relational database management system.\",1,1,\"PostgreSQ"
"L\"]\n"
"-- [2,\"Groonga is a fast full text search engine that supports all languages."
"\",2,2,\"Groonga\"]\n"
"-- [3,\"PGroonga is a PostgreSQL extension that uses Groonga as index.\",3,3,\"P"
"Groonga\"]\n"
"-- [4,\"Mroonga is a MySQL storage engine that uses Groonga as backend.\",4,3,\""
"Mroonga\"]\n"
"-- (6 rows)\n"
"```"
msgstr ""

msgid "The old record is deleted when `VACUUM` is executed."
msgstr "古いレコードは`VACUUM`実行時に削除されます。"

msgid ""
"Execute `VACUUM` explicitly. And then execute `select` Groonga command again. "
"It returns 3 records. There isn't the old record:"
"Execute `VACUUM FULL` explicitly. And then execute `select` Groonga command ag"
"ain. It returns 3 records. There isn't the old record:"
msgstr ""
"明示的に`VACUUM`を実行します。その後、Groongaの`select`コマンドを再度実行します。3レコード返ってきます。ここには古いレコードはありま"
"せん。"
"明示的に`VACUUM FULL`を実行します。その後、Groongaの`select`コマンドを再度実行します。3レコード返ってきます。ここには古いレコー"
"ドはありません。"

msgid ""
"```sql\n"
"VACUUM;\n"
"VACUUM FULL;\n"
"SELECT *\n"
" FROM json_array_elements(\n"
" pgroonga.command('select ' ||\n"
" pgroonga.table_name('pgroonga_terms_index')\n"
" pgroonga.table_name('pgroonga_posts_index')\n"
" )::json->1->0);\n"
"-- value "
" \n"
"-- value "
" \n"
"-- ---------------------------------------------------------------------------"
"---------------------------\n"
"----------------------\n"
"-- [3]\n"
"-- [[\"_id\",\"UInt32\"],[\"_key\",\"UInt64\"],[\"content\",\"LongText\"],[\"tag\",\"ShortTe"
"xt\"],[\"title\",\"LongText\"]]\n"
"-- [1,1,\"PostgreSQLはリレーショナル・データベース管理システムです。\",\"PostgreSQL\",\"PostgreSQL\"]\n"
"-- [2,2,\"Groongaは日本語対応の高速な全文検索エンジンです。\",\"Groonga\",\"Groonga\"]\n"
"-- [4,4,\"MroongaはGroongaをバックエンドにしたMySQLのストレージエンジンです。\",\"MySQL\",\"Mroonga\"]\n"
"-- (5 行)\n"
"-- [[\"_id\",\"UInt32\"],[\"content\",\"LongText\"],[\"ctid\",\"UInt64\"],[\"id\",\"Int32\"],"
"[\"title\",\"LongText\"]]\n"
"-- [1,\"PostgreSQL is a relational database management system.\",1,1,\"PostgreSQ"
"L\"]\n"
"-- [2,\"Groonga is a fast full text search engine that supports all languages."
"\",2,2,\"Groonga\"]\n"
"-- [3,\"Mroonga is a MySQL storage engine that uses Groonga as backend.\",3,3,\""
"Mroonga\"]\n"
"-- (5 rows)\n"
"```"
msgstr ""

Expand Down
77 changes: 47 additions & 30 deletions ja/reference/functions/pgroonga-command.md
Expand Up @@ -35,31 +35,48 @@ Groongaのコマンドは結果をJSONとして返します。`pgroonga.command`

このケースを例で説明します。

例に使うサンプルスキーマとデータは次の通りです。

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

CREATE INDEX pgroonga_posts_index
ON posts
USING pgroonga (id, title, content);

INSERT INTO posts VALUES (1, 'PostgreSQL', 'PostgreSQL is a relational database management system.');
INSERT INTO posts VALUES (2, 'Groonga', 'Groonga is a fast full text search engine that supports all languages.');
INSERT INTO posts VALUES (3, 'PGroonga', 'PGroonga is a PostgreSQL extension that uses Groonga as index.');
```

以下は更新前の結果です。3レコードあります。

```sql
SELECT *
FROM json_array_elements(
pgroonga.command('select ' ||
pgroonga.table_name('pgroonga_terms_index')
pgroonga.table_name('pgroonga_posts_index')
)::json->1->0);
-- value
-- -----------------------------------------------------------------------------------------------------------
-- value
-- -------------------------------------------------------------------------------------------------
-- [3]
-- [["_id","UInt32"],["_key","UInt64"],["content","LongText"],["tag","ShortText"],["title","LongText"]]
-- [1,1,"PostgreSQLはリレーショナル・データベース管理システムです。","PostgreSQL","PostgreSQL"]
-- [2,2,"Groongaは日本語対応の高速な全文検索エンジンです。","Groonga","Groonga"]
-- [3,3,"PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。","PostgreSQL","PGroonga"]
-- (5 )
-- [["_id","UInt32"],["content","LongText"],["ctid","UInt64"],["id","Int32"],["title","LongText"]]
-- [1,"PostgreSQL is a relational database management system.",1,1,"PostgreSQL"]
-- [2,"Groonga is a fast full text search engine that supports all languages.",2,2,"Groonga"]
-- [3,"PGroonga is a PostgreSQL extension that uses Groonga as index.",3,3,"PGroonga"]
-- (5 rows)
```

1つのレコードを更新します。

```sql
UPDATE terms
UPDATE posts
SET title = 'Mroonga',
content = 'MroongaはGroongaをバックエンドにしたMySQLのストレージエンジンです。',
tag = 'MySQL'
content = 'Mroonga is a MySQL storage engine that uses Groonga as backend.'
WHERE id = 3;
```

Expand All @@ -69,38 +86,38 @@ Groongaの`select`コマンドを再度実行します。4レコード返りま
SELECT *
FROM json_array_elements(
pgroonga.command('select ' ||
pgroonga.table_name('pgroonga_terms_index')
pgroonga.table_name('pgroonga_posts_index')
)::json->1->0);
-- value
-- -----------------------------------------------------------------------------------------------------------
-- value
-- -------------------------------------------------------------------------------------------------
-- [4]
-- [["_id","UInt32"],["_key","UInt64"],["content","LongText"],["tag","ShortText"],["title","LongText"]]
-- [1,1,"PostgreSQLはリレーショナル・データベース管理システムです。","PostgreSQL","PostgreSQL"]
-- [2,2,"Groongaは日本語対応の高速な全文検索エンジンです。","Groonga","Groonga"]
-- [3,3,"PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。","PostgreSQL","PGroonga"]
-- [4,4,"MroongaはGroongaをバックエンドにしたMySQLのストレージエンジンです。","MySQL","Mroonga"]
-- (6 )
-- [["_id","UInt32"],["content","LongText"],["ctid","UInt64"],["id","Int32"],["title","LongText"]]
-- [1,"PostgreSQL is a relational database management system.",1,1,"PostgreSQL"]
-- [2,"Groonga is a fast full text search engine that supports all languages.",2,2,"Groonga"]
-- [3,"PGroonga is a PostgreSQL extension that uses Groonga as index.",3,3,"PGroonga"]
-- [4,"Mroonga is a MySQL storage engine that uses Groonga as backend.",4,3,"Mroonga"]
-- (6 rows)
```

古いレコードは`VACUUM`実行時に削除されます。

明示的に`VACUUM`を実行します。その後、Groongaの`select`コマンドを再度実行します。3レコード返ってきます。ここには古いレコードはありません。
明示的に`VACUUM FULL`を実行します。その後、Groongaの`select`コマンドを再度実行します。3レコード返ってきます。ここには古いレコードはありません。

```sql
VACUUM;
VACUUM FULL;
SELECT *
FROM json_array_elements(
pgroonga.command('select ' ||
pgroonga.table_name('pgroonga_terms_index')
pgroonga.table_name('pgroonga_posts_index')
)::json->1->0);
-- value
-- ------------------------------------------------------------------------------------------------------
-- value
-- -------------------------------------------------------------------------------------------------
-- [3]
-- [["_id","UInt32"],["_key","UInt64"],["content","LongText"],["tag","ShortText"],["title","LongText"]]
-- [1,1,"PostgreSQLはリレーショナル・データベース管理システムです。","PostgreSQL","PostgreSQL"]
-- [2,2,"Groongaは日本語対応の高速な全文検索エンジンです。","Groonga","Groonga"]
-- [4,4,"MroongaはGroongaをバックエンドにしたMySQLのストレージエンジンです。","MySQL","Mroonga"]
-- (5 )
-- [["_id","UInt32"],["content","LongText"],["ctid","UInt64"],["id","Int32"],["title","LongText"]]
-- [1,"PostgreSQL is a relational database management system.",1,1,"PostgreSQL"]
-- [2,"Groonga is a fast full text search engine that supports all languages.",2,2,"Groonga"]
-- [3,"Mroonga is a MySQL storage engine that uses Groonga as backend.",3,3,"Mroonga"]
-- (5 rows)
```

## 参考
Expand Down

0 comments on commit c4dfa9c

Please sign in to comment.