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
364 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,248 @@ | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: PACKAGE VERSION\n" | ||
| "PO-Revision-Date: 2015-10-24 09:36+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: CREATE INDEX USING pgroonga\n" | ||
| "layout: en\n" | ||
| "---" | ||
| msgstr "" | ||
| "---\n" | ||
| "title: CREATE INDEX USING pgroonga\n" | ||
| "layout: ja\n" | ||
| "---" | ||
|
|
||
| msgid "# `CREATE INDEX USING pgroonga`" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "You need to specify `USING pgroonga` to `CREATE INDEX` to use PGroonga as inde" | ||
| "x method. This section describes about `pgroonga` index method." | ||
| msgstr "" | ||
| "インデックスメソッドとしてPGroongaを使うためには`CREATE INDEX`に`USING pgroonga`を指定します。このセクションでは`pg" | ||
| "roonga`インデックスメソッドについて説明します。" | ||
|
|
||
| msgid "## Syntax" | ||
| msgstr "## 構文" | ||
|
|
||
| msgid "" | ||
| "This section describes only `pgroonga` index method related `CREATE INDEX` syn" | ||
| "tax. See [`CREATE INDEX` document by PostgreSQL](http://www.postgresql.org/doc" | ||
| "s/{{ site.postgresql_short_version }}/static/sql-createindex.html) for full `C" | ||
| "REATE INDEX` syntax." | ||
| msgstr "" | ||
| "このセクションでは`pgroonga`インデックスメソッド関連の`CREATE INDEX`の構文だけ説明します。完全な`CREATE INDEX`の構文は" | ||
| "[PostgreSQLの`CREATE INDEX`のドキュメント](http://www.postgresql.jp/document/{{ site.p" | ||
| "ostgresql_short_version }}/html/sql-createindex.html)を参照してください。" | ||
|
|
||
| msgid "Here is a basic syntax for creating a single column index:" | ||
| msgstr "シングルカラムインデックスを作成する基本的な構文は次の通りです。" | ||
|
|
||
| msgid "" | ||
| "```sql\n" | ||
| "CREATE INDEX ${INDEX_NAME}\n" | ||
| " ON ${TABLE_NAME}\n" | ||
| " USING pgroonga (${COLUMN});\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "This syntax can be used for the following cases:" | ||
| msgstr "次のケースのときはこの構文を使えます。" | ||
|
|
||
| msgid "" | ||
| " * Creating a full text search index for a `text` type column\n" | ||
| " * Creating a full text search index for an array of `text` type column\n" | ||
| " * Creating a equality condition and comparison conditions search index for a" | ||
| " non `text` type columns\n" | ||
| " * Creating a equality condition and comparison conditions search index for a" | ||
| "n array of non `text` type columns\n" | ||
| " * Creating a contain search and complex search index for `jsonb` type column" | ||
| msgstr "" | ||
| " * `text`型のカラム用の全文検索インデックスを作るとき\n" | ||
| " * `text`型の配列のカラム用の全文検索インデックスを作るとき\n" | ||
| " * `text`型以外の型のカラム用の等価条件・比較条件検索用インデックスを作るとき\n" | ||
| " * `text`型以外の型の配列のカラム用の等価条件・比較条件検索用インデックスを作るとき\n" | ||
| " * `jsonb`型のカラム用のサブセット検索・高度な検索用のインデックスを作るとき" | ||
|
|
||
| msgid "" | ||
| "Here is a basic syntax for creating a full text search index for a `varchar` t" | ||
| "ype column:" | ||
| msgstr "`varchar`型のカラム用の全文検索インデックスを作るときの基本的な構文は次の通りです。" | ||
|
|
||
| msgid "" | ||
| "```sql\n" | ||
| "CREATE INDEX ${INDEX_NAME}\n" | ||
| " ON ${TABLE_NAME}\n" | ||
| " USING pgroonga (${COLUMN}) pgroonga.varchar_full_text_search_ops;\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "You need to specify `pgroonga.varchar_fulltext_search_ops` operator class for " | ||
| "the case." | ||
| msgstr "この場合は`pgroonga.varchar_fulltext_search_ops`オペレータークラスを指定する必要があります。" | ||
|
|
||
| msgid "{: #customization}" | ||
| msgstr "" | ||
|
|
||
| msgid "### Customization" | ||
| msgstr "### カスタマイズ" | ||
|
|
||
| msgid "You can custom the followings by `WITH` option of `CREATE INDEX`:" | ||
| msgstr "`CREATE INDEX`の`WITH`オプションを使って次の項目をカスタマイズできます。" | ||
|
|
||
| msgid "" | ||
| " * Tokenizer: It's a module for customizing how to extract keywords.\n" | ||
| " * Normalizer: It's a module for customizing equality of `text` and `varchar`" | ||
| " types." | ||
| msgstr "" | ||
| " * トークナイザー:キーワードの抽出方法をカスタマイズするモジュールです。\n" | ||
| " * ノーマライザー:`text`型と`varchar`型の等価性をカスタマイズするモジュールです。" | ||
|
|
||
| msgid "" | ||
| "Normally, you don't need to custom them because default values of them are sui" | ||
| "table for most cases. Features to custom them are for advanced users." | ||
| msgstr "" | ||
| "通常、これらをカスタマイズする必要はありません。なぜなら多くの場合で適切なようにデフォルト値が設定されているからです。これらをカスタマイズする機能は高度なユ" | ||
| "ーザー向けの機能です。" | ||
|
|
||
| msgid "Here are default tokenizer and normalizer:" | ||
| msgstr "デフォルトのトークナイザーとノーマライザーは次の通りです。" | ||
|
|
||
| msgid "" | ||
| " * Tokenizer: [`TokenBigram`](http://groonga.org/docs/reference/tokenizers.ht" | ||
| "ml#token-bigram): It's a bigram based tokenizer. It combines bigram tokenizati" | ||
| "on and white space based tokenization. It uses bigram tokenization for non ASC" | ||
| "II characters and white space based tokenization for ASCII characters. It redu" | ||
| "ces noise for ASCII characters only query.\n" | ||
| " * Normalizer: [`NormalizerAuto`](http://groonga.org/docs/reference/normalize" | ||
| "rs.html#normalizer-auto): It chooses suitable normalization based on target en" | ||
| "coding. For example, it uses [Unicode NFKC](http://unicode.org/reports/tr15/) " | ||
| "based normalization for UTF-8." | ||
| msgstr "" | ||
| " * トークナイザー:[`TokenBigram`](http://groonga.org/ja/docs/reference/tokenizers.ht" | ||
| "ml#token-bigram):bigramベースのトークナイザーです。このトークナイザーはbigramベースのトークナイズ方法とスペース区切りベースのト" | ||
| "ークナイズ方法を組み合わせています。非ASCII文字にはbigramベースのトークナイズ方法を使い、ASCII文字にはスペース区切りベースのトークナイズ方法" | ||
| "を使います。これはASCII文字だけのクエリーで検索したときのノイズを減らすためです。\n" | ||
| " * ノーマライザー:[`NormalizerAuto`](http://groonga.org/ja/docs/reference/normalizer" | ||
| "s.html#normalizer-auto):対象のエンコーディングに合わせて適切なノーマライズ方法を選びます。たとえば、UTF-8の場合は[Unicod" | ||
| "e NFKC](http://unicode.org/reports/tr15/)ベースのノーマライズ方法を使います。" | ||
|
|
||
| msgid "#### How to custom tokenizer" | ||
| msgstr "#### トークナイザーのカスタマイズ方法" | ||
|
|
||
| msgid "" | ||
| "Specify `tokenizer='${TOKENIZER_NAME}'` for customizing tokenizer. Normally, y" | ||
| "ou don't need to custom tokenizer." | ||
| msgstr "トークナイザーをカスタマイズするには`tokenizer='${トークナイザー名}'`を指定します。通常、トークナイザーをカスタマイズする必要はありません。" | ||
|
|
||
| msgid "" | ||
| "Here is an example to use [MeCab](http://taku910.github.io/mecab/) based token" | ||
| "izer. You need to specify `tokenizer='TokenMecab'`. [`TokenMecab`](http://groo" | ||
| "nga.org/docs/reference/tokenizers.html#token-mecab) is a name of MeCab based t" | ||
| "okenizer." | ||
| msgstr "" | ||
| "以下は[MeCab](http://taku910.github.io/mecab/)ベースのトークナイザーを使う例です。`tokenizer='Token" | ||
| "Mecab'`を指定する必要があります。[`TokenMecab`](http://groonga.org/ja/docs/reference/tokeni" | ||
| "zers.html#token-mecab)はMeCabベースのトークナイザーの名前です。" | ||
|
|
||
| msgid "" | ||
| "```sql\n" | ||
| "CREATE TABLE memos (\n" | ||
| " id integer,\n" | ||
| " content text\n" | ||
| ");" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "CREATE INDEX pgroonga_content_index\n" | ||
| " ON memos\n" | ||
| " USING pgroonga (content)\n" | ||
| " WITH (tokenizer='TokenMecab');\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "You can disable tokenizer by specifying `tokenizer=''`. If you disable tokeniz" | ||
| "er, you can search column value only by exact match search and prefix search. " | ||
| "It reduces noise for some cases. For example, it's useful for tag search, name" | ||
| " search and so on." | ||
| msgstr "" | ||
| "`tokenizer=''`と指定することでトークナイザーを無効にすることができます。トークナイザーを無効にすると、完全一致検索または前方一致検索のみでカラ" | ||
| "ムの値を検索できます。これにより誤ヒットが少なくなるケースがあります。例えば、タグ検索・名前検索などのときは有用です。" | ||
|
|
||
| msgid "Here is an example to disable tokenizer:" | ||
| msgstr "以下はトークナイザーを無効にする例です。" | ||
|
|
||
| msgid "" | ||
| "```sql\n" | ||
| "CREATE TABLE memos (\n" | ||
| " id integer,\n" | ||
| " tag text\n" | ||
| ");" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "CREATE INDEX pgroonga_tag_index\n" | ||
| " ON memos\n" | ||
| " USING pgroonga (tag)\n" | ||
| " WITH (tokenizer='');\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "`tokenizer='TokenDelimit'` will be useful for tag search. See also [`TokenDeli" | ||
| "mit`](http://groonga.org/docs/reference/tokenizers.html#token-delimit)." | ||
| msgstr "" | ||
| "`tokenizer='TokenDelimit'`はタグ検索で便利です。[`TokenDelimit`](http://groonga.org/ja/do" | ||
| "cs/reference/tokenizers.html#token-delimit)も参照してください。" | ||
|
|
||
| msgid "" | ||
| "See [Tokenizers](http://groonga.org/docs/reference/tokenizers.html) for other " | ||
| "tokenizers." | ||
| msgstr "" | ||
| "他のトークナイザーについては[トークナイザー](http://groonga.org/ja/docs/reference/tokenizers.html)を" | ||
| "参照してください。" | ||
|
|
||
| msgid "#### How to custom normalizer" | ||
| msgstr "#### ノーマライザーのカスタマイズ方法" | ||
|
|
||
| msgid "" | ||
| "Specify `normalizer='${NORMALIZER_NAME}'` for customizing normalizer. Normally" | ||
| ", you don't need to custom normalizer." | ||
| msgstr "" | ||
| "ノーマライザーをカスタマイズするには`normalizer='${ノーマライザー名}'`を指定してください。通常はノーマライザーをカスタマイズする必要はあり" | ||
| "ません。" | ||
|
|
||
| msgid "" | ||
| "You can disable normalizer by specifying `normalizer=''`. If you disable norma" | ||
| "lizer, you can search column value only by the original column value. If norma" | ||
| "lizer increases noise, it's useful." | ||
| msgstr "" | ||
| "`normalizer=''`を指定するとノーマライザーを無効にすることができます。ノーマライザーを無効にすると元のカラムの値そのものでだけ検索できます。も" | ||
| "し、ノーマライザーを使うことで誤ヒットが増える場合は無効にした方がよいでしょう。" | ||
|
|
||
| msgid "Here is an example to disable normalizer:" | ||
| msgstr "ノーマライザーを無効にする方法は次の通りです。" | ||
|
|
||
| msgid "" | ||
| "CREATE INDEX pgroonga_tag_index\n" | ||
| " ON memos\n" | ||
| " USING pgroonga (tag)\n" | ||
| " WITH (normalizer='');\n" | ||
| "```" | ||
| msgstr "" | ||
|
|
||
| msgid "" | ||
| "See [Normalizers](http://groonga.org/docs/reference/normalizers.html) for othe" | ||
| "r normalizers." | ||
| msgstr "" | ||
| "他のノーマライザーについては[ノーマライザー](http://groonga.org/ja/docs/reference/normalizers.html)" | ||
| "を参照してください。" |
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,114 @@ | ||
| --- | ||
| title: CREATE INDEX USING pgroonga | ||
| layout: ja | ||
| --- | ||
|
|
||
| # `CREATE INDEX USING pgroonga` | ||
|
|
||
| インデックスメソッドとしてPGroongaを使うためには`CREATE INDEX`に`USING pgroonga`を指定します。このセクションでは`pgroonga`インデックスメソッドについて説明します。 | ||
|
|
||
| ## 構文 | ||
|
|
||
| このセクションでは`pgroonga`インデックスメソッド関連の`CREATE INDEX`の構文だけ説明します。完全な`CREATE INDEX`の構文は[PostgreSQLの`CREATE INDEX`のドキュメント](http://www.postgresql.jp/document/{{ site.postgresql_short_version }}/html/sql-createindex.html)を参照してください。 | ||
|
|
||
| シングルカラムインデックスを作成する基本的な構文は次の通りです。 | ||
|
|
||
| ```sql | ||
| CREATE INDEX ${INDEX_NAME} | ||
| ON ${TABLE_NAME} | ||
| USING pgroonga (${COLUMN}); | ||
| ``` | ||
|
|
||
| 次のケースのときはこの構文を使えます。 | ||
|
|
||
| * `text`型のカラム用の全文検索インデックスを作るとき | ||
| * `text`型の配列のカラム用の全文検索インデックスを作るとき | ||
| * `text`型以外の型のカラム用の等価条件・比較条件検索用インデックスを作るとき | ||
| * `text`型以外の型の配列のカラム用の等価条件・比較条件検索用インデックスを作るとき | ||
| * `jsonb`型のカラム用のサブセット検索・高度な検索用のインデックスを作るとき | ||
|
|
||
| `varchar`型のカラム用の全文検索インデックスを作るときの基本的な構文は次の通りです。 | ||
|
|
||
| ```sql | ||
| CREATE INDEX ${INDEX_NAME} | ||
| ON ${TABLE_NAME} | ||
| USING pgroonga (${COLUMN}) pgroonga.varchar_full_text_search_ops; | ||
| ``` | ||
|
|
||
| この場合は`pgroonga.varchar_fulltext_search_ops`オペレータークラスを指定する必要があります。 | ||
|
|
||
| {: #customization} | ||
|
|
||
| ### カスタマイズ | ||
|
|
||
| `CREATE INDEX`の`WITH`オプションを使って次の項目をカスタマイズできます。 | ||
|
|
||
| * トークナイザー:キーワードの抽出方法をカスタマイズするモジュールです。 | ||
| * ノーマライザー:`text`型と`varchar`型の等価性をカスタマイズするモジュールです。 | ||
|
|
||
| 通常、これらをカスタマイズする必要はありません。なぜなら多くの場合で適切なようにデフォルト値が設定されているからです。これらをカスタマイズする機能は高度なユーザー向けの機能です。 | ||
|
|
||
| デフォルトのトークナイザーとノーマライザーは次の通りです。 | ||
|
|
||
| * トークナイザー:[`TokenBigram`](http://groonga.org/ja/docs/reference/tokenizers.html#token-bigram):bigramベースのトークナイザーです。このトークナイザーはbigramベースのトークナイズ方法とスペース区切りベースのトークナイズ方法を組み合わせています。非ASCII文字にはbigramベースのトークナイズ方法を使い、ASCII文字にはスペース区切りベースのトークナイズ方法を使います。これはASCII文字だけのクエリーで検索したときのノイズを減らすためです。 | ||
| * ノーマライザー:[`NormalizerAuto`](http://groonga.org/ja/docs/reference/normalizers.html#normalizer-auto):対象のエンコーディングに合わせて適切なノーマライズ方法を選びます。たとえば、UTF-8の場合は[Unicode NFKC](http://unicode.org/reports/tr15/)ベースのノーマライズ方法を使います。 | ||
|
|
||
| #### トークナイザーのカスタマイズ方法 | ||
|
|
||
| トークナイザーをカスタマイズするには`tokenizer='${トークナイザー名}'`を指定します。通常、トークナイザーをカスタマイズする必要はありません。 | ||
|
|
||
| 以下は[MeCab](http://taku910.github.io/mecab/)ベースのトークナイザーを使う例です。`tokenizer='TokenMecab'`を指定する必要があります。[`TokenMecab`](http://groonga.org/ja/docs/reference/tokenizers.html#token-mecab)はMeCabベースのトークナイザーの名前です。 | ||
|
|
||
| ```sql | ||
| CREATE TABLE memos ( | ||
| id integer, | ||
| content text | ||
| ); | ||
|
|
||
| CREATE INDEX pgroonga_content_index | ||
| ON memos | ||
| USING pgroonga (content) | ||
| WITH (tokenizer='TokenMecab'); | ||
| ``` | ||
|
|
||
| `tokenizer=''`と指定することでトークナイザーを無効にすることができます。トークナイザーを無効にすると、完全一致検索または前方一致検索のみでカラムの値を検索できます。これにより誤ヒットが少なくなるケースがあります。例えば、タグ検索・名前検索などのときは有用です。 | ||
|
|
||
| 以下はトークナイザーを無効にする例です。 | ||
|
|
||
| ```sql | ||
| CREATE TABLE memos ( | ||
| id integer, | ||
| tag text | ||
| ); | ||
|
|
||
| CREATE INDEX pgroonga_tag_index | ||
| ON memos | ||
| USING pgroonga (tag) | ||
| WITH (tokenizer=''); | ||
| ``` | ||
|
|
||
| `tokenizer='TokenDelimit'`はタグ検索で便利です。[`TokenDelimit`](http://groonga.org/ja/docs/reference/tokenizers.html#token-delimit)も参照してください。 | ||
|
|
||
| 他のトークナイザーについては[トークナイザー](http://groonga.org/ja/docs/reference/tokenizers.html)を参照してください。 | ||
|
|
||
| #### ノーマライザーのカスタマイズ方法 | ||
|
|
||
| ノーマライザーをカスタマイズするには`normalizer='${ノーマライザー名}'`を指定してください。通常はノーマライザーをカスタマイズする必要はありません。 | ||
|
|
||
| `normalizer=''`を指定するとノーマライザーを無効にすることができます。ノーマライザーを無効にすると元のカラムの値そのものでだけ検索できます。もし、ノーマライザーを使うことで誤ヒットが増える場合は無効にした方がよいでしょう。 | ||
|
|
||
| ノーマライザーを無効にする方法は次の通りです。 | ||
|
|
||
| ```sql | ||
| CREATE TABLE memos ( | ||
| id integer, | ||
| tag text | ||
| ); | ||
|
|
||
| CREATE INDEX pgroonga_tag_index | ||
| ON memos | ||
| USING pgroonga (tag) | ||
| WITH (normalizer=''); | ||
| ``` | ||
|
|
||
| 他のノーマライザーについては[ノーマライザー](http://groonga.org/ja/docs/reference/normalizers.html)を参照してください。 |
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