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 9d96e51 commit b6e5cdf
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 37 deletions.
89 changes: 69 additions & 20 deletions _po/ja/reference/operators/like.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: 2015-10-24 17:43+0900\n"
"PO-Revision-Date: 2015-10-25 22:00+0900\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -52,21 +52,65 @@ msgid ""
"IKE` operator with index searches with case insensitive."
msgstr "たとえば、元の`LIKE`演算子は大文字小文字を区別して検索します。しかし、インデックスを使った`LIKE`演算子は大文字小文字を区別しません。"

msgid "Here are sample schema and data:"
msgstr ""

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

msgid ""
"CREATE INDEX pgroonga_content_index ON memos USING pgroonga (content);\n"
"```"
msgstr ""

msgid ""
"```sql\n"
"INSERT INTO memos VALUES (1, 'PostgreSQL is a relational database management s"
"ystem.');\n"
"INSERT INTO memos VALUES (2, 'Groonga is a fast full text search engine that s"
"upports all languages.');\n"
"INSERT INTO memos VALUES (3, 'PGroonga is a PostgreSQL extension that uses Gro"
"onga as index.');\n"
"INSERT INTO memos VALUES (4, 'There is groonga command.');\n"
"```"
msgstr ""
"```sql\n"
"INSERT INTO memos VALUES (1, 'PostgreSQLはリレーショナル・データベース管理システムです。');\n"
"INSERT INTO memos VALUES (2, 'Groongaは日本語対応の高速な全文検索エンジンです。');\n"
"INSERT INTO memos VALUES (3, 'PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です"
"。');\n"
"INSERT INTO memos VALUES (4, 'groongaコマンドがあります。');\n"
"```"

msgid "A search result of the original `LIKE` operator:"
msgstr "元の`LIKE`演算子の結果です。"

msgid ""
"```sql\n"
"SET enable_seqscan = on;\n"
"SET enable_indexscan = off;\n"
"SET enable_bitmapscan = off;\n"
"SET enable_bitmapscan = off;"
msgstr ""

msgid ""
"SELECT * FROM memos WHERE content LIKE '%groonga%';\n"
"-- id | content \n"
"-- ----+---------------------------\n"
"-- 4 | There is groonga command.\n"
"-- (1 row)\n"
"```"
msgstr ""
"SELECT * FROM memos WHERE content LIKE '%groonga%';\n"
"-- id | content \n"
"-- ----+-----------------------------\n"
"-- 4 | groongaコマンドがあります。\n"
"-- (1 )\n"
"-- (1 row)\n"
"```"
msgstr ""

msgid "A search result of `LIKE` operator with index:"
msgstr "インデックスを使った`LIKE`演算子の結果です。"
Expand All @@ -75,7 +119,22 @@ msgid ""
"```sql\n"
"SET enable_seqscan = off;\n"
"SET enable_indexscan = on;\n"
"SET enable_bitmapscan = on;\n"
"SET enable_bitmapscan = on;"
msgstr ""

msgid ""
"SELECT * FROM memos WHERE content LIKE '%groonga%';\n"
"-- id | content "
" \n"
"-- ----+----------------------------------------------------------------------"
"--\n"
"-- 2 | Groonga is a fast full text search engine that supports all languages"
".\n"
"-- 3 | PGroonga is a PostgreSQL extension that uses Groonga as index.\n"
"-- 4 | There is groonga command.\n"
"-- (3 rows)\n"
"```"
msgstr ""
"SELECT * FROM memos WHERE content LIKE '%groonga%';\n"
"-- id | content "
" \n"
Expand All @@ -84,9 +143,8 @@ msgid ""
"-- 2 | Groongaは日本語対応の高速な全文検索エンジンです。\n"
"-- 3 | PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。\n"
"-- 4 | groongaコマンドがあります。\n"
"-- (3 )\n"
"-- (3 rows)\n"
"```"
msgstr ""

msgid ""
"If you want to get the same result by both `LIKE` operator with index and the "
Expand All @@ -105,6 +163,10 @@ msgstr "具体例は次の通りです。"

msgid ""
"```sql\n"
"DROP INDEX IF EXISTS pgroonga_content_index;"
msgstr ""

msgid ""
"CREATE INDEX pgroonga_content_index\n"
" ON memos\n"
" USING pgroonga (content)\n"
Expand All @@ -118,19 +180,6 @@ msgid ""
"or with index:"
msgstr "元の`LIKE`演算子とインデックスを使った`LIKE`演算子で同じ結果が返ります。"

msgid ""
"```sql\n"
"SET enable_seqscan = off;\n"
"SET enable_indexscan = on;\n"
"SET enable_bitmapscan = on;\n"
"SELECT * FROM memos WHERE content LIKE '%groonga%';\n"
"-- id | content \n"
"-- ----+-----------------------------\n"
"-- 4 | groongaコマンドがあります。\n"
"-- (1 行)\n"
"```"
msgstr ""

msgid ""
"Normally, the default configuration returns better result for full text search"
" rather than the original `LIKE` operator. Think about which result is better "
Expand Down
29 changes: 26 additions & 3 deletions ja/reference/operators/like.md
Expand Up @@ -13,17 +13,36 @@ PGroongaは内部的に`column LIKE '%キーワード%'`条件を`column %% 'キ

たとえば、元の`LIKE`演算子は大文字小文字を区別して検索します。しかし、インデックスを使った`LIKE`演算子は大文字小文字を区別しません。

Here are sample schema and data:

```sql
CREATE TABLE memos (
id integer,
content text
);

CREATE INDEX pgroonga_content_index ON memos USING pgroonga (content);
```

```sql
INSERT INTO memos VALUES (1, 'PostgreSQLはリレーショナル・データベース管理システムです。');
INSERT INTO memos VALUES (2, 'Groongaは日本語対応の高速な全文検索エンジンです。');
INSERT INTO memos VALUES (3, 'PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。');
INSERT INTO memos VALUES (4, 'groongaコマンドがあります。');
```

元の`LIKE`演算子の結果です。

```sql
SET enable_seqscan = on;
SET enable_indexscan = off;
SET enable_bitmapscan = off;

SELECT * FROM memos WHERE content LIKE '%groonga%';
-- id | content
-- ----+-----------------------------
-- 4 | groongaコマンドがあります。
-- (1 )
-- (1 row)
```

インデックスを使った`LIKE`演算子の結果です。
Expand All @@ -32,13 +51,14 @@ SELECT * FROM memos WHERE content LIKE '%groonga%';
SET enable_seqscan = off;
SET enable_indexscan = on;
SET enable_bitmapscan = on;

SELECT * FROM memos WHERE content LIKE '%groonga%';
-- id | content
-- ----+---------------------------------------------------------------------------
-- 2 | Groongaは日本語対応の高速な全文検索エンジンです。
-- 3 | PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。
-- 4 | groongaコマンドがあります。
-- (3 )
-- (3 rows)
```

インデックスを使った`LIKE`演算子の結果と元の`LIKE`演算子の結果を同じにしたい場合は次のトークナイザーとノーマライザーを使います。
Expand All @@ -49,6 +69,8 @@ SELECT * FROM memos WHERE content LIKE '%groonga%';
具体例は次の通りです。

```sql
DROP INDEX IF EXISTS pgroonga_content_index;

CREATE INDEX pgroonga_content_index
ON memos
USING pgroonga (content)
Expand All @@ -62,11 +84,12 @@ CREATE INDEX pgroonga_content_index
SET enable_seqscan = off;
SET enable_indexscan = on;
SET enable_bitmapscan = on;

SELECT * FROM memos WHERE content LIKE '%groonga%';
-- id | content
-- ----+-----------------------------
-- 4 | groongaコマンドがあります。
-- (1 )
-- (1 row)
```

通常、デフォルトの設定は元の`LIKE`演算子よりも適切な全文検索結果を返す設定です。もし、デフォルトの設定をするときは、変更する前にユーザーにとてどのような結果が適切かを考えてください。
Expand Down
51 changes: 37 additions & 14 deletions reference/operators/like.md
Expand Up @@ -13,17 +13,36 @@ The original `LIKE` operator searches against text as is. But `%%` operator does

For example, the original `LIKE` operator searches with case sensitive. But `LIKE` operator with index searches with case insensitive.

Here are sample schema and data:

```sql
CREATE TABLE memos (
id integer,
content text
);

CREATE INDEX pgroonga_content_index ON memos USING pgroonga (content);
```

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

A search result of the original `LIKE` operator:

```sql
SET enable_seqscan = on;
SET enable_indexscan = off;
SET enable_bitmapscan = off;

SELECT * FROM memos WHERE content LIKE '%groonga%';
-- id | content
-- ----+-----------------------------
-- 4 | groongaコマンドがあります。
-- (1 )
-- id | content
-- ----+---------------------------
-- 4 | There is groonga command.
-- (1 row)
```

A search result of `LIKE` operator with index:
Expand All @@ -32,13 +51,14 @@ A search result of `LIKE` operator with index:
SET enable_seqscan = off;
SET enable_indexscan = on;
SET enable_bitmapscan = on;

SELECT * FROM memos WHERE content LIKE '%groonga%';
-- id | content
-- ----+---------------------------------------------------------------------------
-- 2 | Groongaは日本語対応の高速な全文検索エンジンです。
-- 3 | PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。
-- 4 | groongaコマンドがあります。
-- (3 )
-- id | content
-- ----+------------------------------------------------------------------------
-- 2 | Groonga is a fast full text search engine that supports all languages.
-- 3 | PGroonga is a PostgreSQL extension that uses Groonga as index.
-- 4 | There is groonga command.
-- (3 rows)
```

If you want to get the same result by both `LIKE` operator with index and the original `LIKE` operator, use the following tokenizer and normalizer:
Expand All @@ -49,6 +69,8 @@ If you want to get the same result by both `LIKE` operator with index and the or
Here is a concrete example:

```sql
DROP INDEX IF EXISTS pgroonga_content_index;

CREATE INDEX pgroonga_content_index
ON memos
USING pgroonga (content)
Expand All @@ -62,11 +84,12 @@ You can get the same result as the original `LIKE` operator with `LIKE` operator
SET enable_seqscan = off;
SET enable_indexscan = on;
SET enable_bitmapscan = on;

SELECT * FROM memos WHERE content LIKE '%groonga%';
-- id | content
-- ----+-----------------------------
-- 4 | groongaコマンドがあります。
-- (1 )
-- id | content
-- ----+---------------------------
-- 4 | There is groonga command.
-- (1 row)
```

Normally, the default configuration returns better result for full text search rather than the original `LIKE` operator. Think about which result is better for users before you change the default configuration.
Expand Down

0 comments on commit b6e5cdf

Please sign in to comment.