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
2 changed files
with
221 additions
and
0 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,147 @@ | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: PACKAGE VERSION\n" | ||
| "PO-Revision-Date: 2015-10-24 17:43+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: LIKE operator\n" | ||
| "layout: en\n" | ||
| "---" | ||
| msgstr "" | ||
| "---\n" | ||
| "title: LIKE演算子\n" | ||
| "layout: ja\n" | ||
| "---" | ||
|
|
||
| msgid "# `LIKE` operator" | ||
| msgstr "# `LIKE`演算子" | ||
|
|
||
| msgid "" | ||
| "PGroonga converts `column LIKE '%KEYWORD%'` condition to `column %% 'KEYWORD'`" | ||
| " internally. [`%%` operator](match.html) does full text search with index. It'" | ||
| "s fast rather than `LIKE` operator without index." | ||
| msgstr "" | ||
| "PGroongaは内部的に`column LIKE '%キーワード%'`条件を`column %% 'キーワード'`条件に変換します。[`%%`演算子](m" | ||
| "atch.html)はインデックスを使って全文検索をします。これはインデックスを使わない`LIKE`演算子より速いです。" | ||
|
|
||
| msgid "" | ||
| "Both beginning `%` and ending `%` are important. `'KEYWORD%'`, `'%KEYWORD'` an" | ||
| "d so on aren't converted to `column %% 'KEYWORD'`. PGroonga returns no records" | ||
| " for these patterns. Because PGroonga can't search these patterns with index." | ||
| msgstr "" | ||
| "最初の`%`と最後の`%`はどちらも重要です。`'キーワード%'`、`'%キーワード'`などは`column %% 'キーワード'`に変換されます。このよう" | ||
| "なパターンを指定するとPGroongaは1件もレコードを返しません。なぜならPGroongaはインデックスなしではこれらのパターンを検索できないからです。" | ||
|
|
||
| msgid "" | ||
| "The original `LIKE` operator searches against text as is. But `%%` operator do" | ||
| "es full text search against normalized text. It means that search result of `L" | ||
| "IKE` operator with index and search result of the original `LIKE` operator may" | ||
| " be different." | ||
| msgstr "" | ||
| "元の`LIKE`演算子は対象テキストに対して検索します。しかし、`%%`演算子は正規化したテキストに対して検索します。これは、インデックスを使った`LIKE" | ||
| "`演算子の検索結果と、元の`LIKE`演算子の検索結果は異なるということです。" | ||
|
|
||
| msgid "" | ||
| "For example, the original `LIKE` operator searches with case sensitive. But `L" | ||
| "IKE` operator with index searches with case insensitive." | ||
| msgstr "たとえば、元の`LIKE`演算子は大文字小文字を区別して検索します。しかし、インデックスを使った`LIKE`演算子は大文字小文字を区別しません。" | ||
|
|
||
| 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" | ||
| "SELECT * FROM memos WHERE content LIKE '%groonga%';\n" | ||
| "-- id | content \n" | ||
| "-- ----+-----------------------------\n" | ||
| "-- 4 | groongaコマンドがあります。\n" | ||
| "-- (1 行)\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "A search result of `LIKE` operator with index:" | ||
| msgstr "インデックスを使った`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" | ||
| "-- 2 | Groongaは日本語対応の高速な全文検索エンジンです。\n" | ||
| "-- 3 | PGroongaはインデックスとしてGroongaを使うためのPostgreSQLの拡張機能です。\n" | ||
| "-- 4 | groongaコマンドがあります。\n" | ||
| "-- (3 行)\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "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:" | ||
| msgstr "インデックスを使った`LIKE`演算子の結果と元の`LIKE`演算子の結果を同じにしたい場合は次のトークナイザーとノーマライザーを使います。" | ||
|
|
||
| msgid "" | ||
| " * Tokenizer: `TokenBigramSplitSymbolAlphaDigit`\n" | ||
| " * Normalizer: None" | ||
| msgstr "" | ||
| " * トークナイザー: `TokenBigramSplitSymbolAlphaDigit`\n" | ||
| " * ノーマライザー: なし" | ||
|
|
||
| msgid "Here is a concrete example:" | ||
| msgstr "具体例は次の通りです。" | ||
|
|
||
| msgid "" | ||
| "```sql\n" | ||
| "CREATE INDEX pgroonga_content_index\n" | ||
| " ON memos\n" | ||
| " USING pgroonga (content)\n" | ||
| " WITH (tokenizer='TokenBigramSplitSymbolAlphaDigit',\n" | ||
| " normalizer='');\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "You can get the same result as the original `LIKE` operator with `LIKE` operat" | ||
| "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 " | ||
| "for users before you change the default configuration." | ||
| msgstr "" | ||
| "通常、デフォルトの設定は元の`LIKE`演算子よりも適切な全文検索結果を返す設定です。もし、デフォルトの設定をするときは、変更する前にユーザーにとてどのよう" | ||
| "な結果が適切かを考えてください。" | ||
|
|
||
| msgid "" | ||
| "See [Customization in `CREATE INDEX USING pgroonga`](../create-index-using-pgr" | ||
| "oonga.html#customization) for tokenizer and normalizer." | ||
| msgstr "" | ||
| "トークナイザーとノーマライザーをカスタマイズする方法については[`CREATE INDEX USING pgroonga`のカスタマイズ](../creat" | ||
| "e-index-using-pgroonga.html#customization)を参照してください。" |
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,74 @@ | ||
| --- | ||
| title: LIKE演算子 | ||
| layout: ja | ||
| --- | ||
|
|
||
| # `LIKE`演算子 | ||
|
|
||
| PGroongaは内部的に`column LIKE '%キーワード%'`条件を`column %% 'キーワード'`条件に変換します。[`%%`演算子](match.html)はインデックスを使って全文検索をします。これはインデックスを使わない`LIKE`演算子より速いです。 | ||
|
|
||
| 最初の`%`と最後の`%`はどちらも重要です。`'キーワード%'`、`'%キーワード'`などは`column %% 'キーワード'`に変換されます。このようなパターンを指定するとPGroongaは1件もレコードを返しません。なぜならPGroongaはインデックスなしではこれらのパターンを検索できないからです。 | ||
|
|
||
| 元の`LIKE`演算子は対象テキストに対して検索します。しかし、`%%`演算子は正規化したテキストに対して検索します。これは、インデックスを使った`LIKE`演算子の検索結果と、元の`LIKE`演算子の検索結果は異なるということです。 | ||
|
|
||
| たとえば、元の`LIKE`演算子は大文字小文字を区別して検索します。しかし、インデックスを使った`LIKE`演算子は大文字小文字を区別しません。 | ||
|
|
||
| 元の`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 行) | ||
| ``` | ||
|
|
||
| インデックスを使った`LIKE`演算子の結果です。 | ||
|
|
||
| ```sql | ||
| 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 行) | ||
| ``` | ||
|
|
||
| インデックスを使った`LIKE`演算子の結果と元の`LIKE`演算子の結果を同じにしたい場合は次のトークナイザーとノーマライザーを使います。 | ||
|
|
||
| * トークナイザー: `TokenBigramSplitSymbolAlphaDigit` | ||
| * ノーマライザー: なし | ||
|
|
||
| 具体例は次の通りです。 | ||
|
|
||
| ```sql | ||
| CREATE INDEX pgroonga_content_index | ||
| ON memos | ||
| USING pgroonga (content) | ||
| WITH (tokenizer='TokenBigramSplitSymbolAlphaDigit', | ||
| normalizer=''); | ||
| ``` | ||
|
|
||
| 元の`LIKE`演算子とインデックスを使った`LIKE`演算子で同じ結果が返ります。 | ||
|
|
||
| ```sql | ||
| SET enable_seqscan = off; | ||
| SET enable_indexscan = on; | ||
| SET enable_bitmapscan = on; | ||
| SELECT * FROM memos WHERE content LIKE '%groonga%'; | ||
| -- id | content | ||
| -- ----+----------------------------- | ||
| -- 4 | groongaコマンドがあります。 | ||
| -- (1 行) | ||
| ``` | ||
|
|
||
| 通常、デフォルトの設定は元の`LIKE`演算子よりも適切な全文検索結果を返す設定です。もし、デフォルトの設定をするときは、変更する前にユーザーにとてどのような結果が適切かを考えてください。 | ||
|
|
||
| トークナイザーとノーマライザーをカスタマイズする方法については[`CREATE INDEX USING pgroonga`のカスタマイズ](../create-index-using-pgroonga.html#customization)を参照してください。 |