[Groonga-commit] pgroonga/pgroonga.github.io at 0bb3a93 [master] Add token_filters and plugins options

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Wed Apr 26 18:09:03 JST 2017


Kouhei Sutou	2017-04-26 18:09:03 +0900 (Wed, 26 Apr 2017)

  New Revision: 0bb3a935e67054fa1aee8151e038b195b5c0572c
  https://github.com/pgroonga/pgroonga.github.io/commit/0bb3a935e67054fa1aee8151e038b195b5c0572c

  Message:
    Add token_filters and plugins options

  Modified files:
    _po/ja/reference/create-index-using-pgroonga.po
    ja/reference/create-index-using-pgroonga.md
    reference/create-index-using-pgroonga.md

  Modified: _po/ja/reference/create-index-using-pgroonga.po (+116 -22)
===================================================================
--- _po/ja/reference/create-index-using-pgroonga.po    2017-04-26 16:38:01 +0900 (c84e6ef)
+++ _po/ja/reference/create-index-using-pgroonga.po    2017-04-26 18:09:03 +0900 (e2a994b)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"PO-Revision-Date: 2016-11-11 23:09+0900\n"
+"PO-Revision-Date: 2017-04-26 18:08+0900\n"
 "Language: ja\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -93,21 +93,35 @@ 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"
+"  * Plugin: It's an extension for Groonga. You can use additional features inc"
+"luding additional tokenizers, normalizers and token filters by registering a p"
+"lugin."
+msgstr ""
+"  * プラグイン:Groongaの拡張機能です。プラグインを登録することで追加の機能を使うことができます。追加の機能には追加のトークナイザー・ノーマライザ"
+"ー・トークンフィルターなどがあります。"
+
+msgid "  * Tokenizer: It's a module for customizing how to extract keywords."
+msgstr "  * トークナイザー:キーワードの抽出方法をカスタマイズするモジュールです。"
+
+msgid ""
 "  * Normalizer: It's a module for customizing equality of `text` and `varchar`"
 " types."
-msgstr ""
-"  * トークナイザー:キーワードの抽出方法をカスタマイズするモジュールです。\n"
-"  * ノーマライザー:`text`型と`varchar`型の等価性をカスタマイズするモジュールです。"
+msgstr "  * ノーマライザー:`text`型と`varchar`型の等価性をカスタマイズするモジュールです。"
+
+msgid "  * Token filter: It's a module for filtering keywords extracted by tokenizer."
+msgstr "  * トークンフィルター:トークナイザーが抽出したキーワードをフィルターするモジュールです。"
 
 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."
+"Normally, you don't need to custom them because the default values of them are"
+" suitable for most cases. Features to custom them are for advanced users."
 msgstr ""
 "通常、これらをカスタマイズする必要はありません。なぜなら多くの場合で適切なようにデフォルト値が設定されているからです。これらをカスタマイズする機能は高度なユ"
 "ーザー向けの機能です。"
 
-msgid "Here are default tokenizer and normalizer:"
+msgid "Plugin and token filter aren't used by default."
+msgstr "デフォルトではプラグインとトークンフィルターは使われていません。"
+
+msgid "Here are the default tokenizer and normalizer:"
 msgstr "デフォルトのトークナイザーとノーマライザーは次の通りです。"
 
 msgid ""
@@ -115,19 +129,70 @@ msgid ""
 "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"
+"ces noise for ASCII characters only query."
+msgstr ""
+"  * トークナイザー:[`TokenBigram`](http://groonga.org/ja/docs/reference/tokenizers.ht"
+"ml#token-bigram):bigramベースのトークナイザーです。このトークナイザーはbigramベースのトークナイズ方法とスペース区切りベースのト"
+"ークナイズ方法を組み合わせています。非ASCII文字にはbigramベースのトークナイズ方法を使い、ASCII文字にはスペース区切りベースのトークナイズ方法"
+"を使います。これはASCII文字だけのクエリーで検索したときのノイズを減らすためです。"
+
+msgid ""
 "  * 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/)ベースのノーマライズ方法を使います。"
+"e NFKC](http://unicode.org/reports/tr15/)ベースのノーマライズ方法を使います。\n"
+
+msgid "#### How to register plugins {#custom-plugins}"
+msgstr "#### プラグインの登録方法 {#custom-plugins}"
+
+msgid "Since 1.2.0."
+msgstr "1.2.0で追加。"
+
+msgid ""
+"Specify `plugins='${PLUGIN_NAME_1}, ${PLUGIN_NAME_2}, ..., ${PLUGIN_NAME_N}'` "
+"for registering plugins."
+msgstr "プラグインを登録するには`plugins='${プラグイン名1}, ${プラグイン名2}, ..., ${プラグイン名N}'`を指定します。"
+
+msgid ""
+"Note that you must specify `plugins` as the first option in `CREATE INDEX`. Op"
+"tions in `CREATE INDEX` are processed by the specified order. Plugins should b"
+"e registered before other options are processed because tokenizer, normalizer "
+"and token filters may be included in the plugins."
+msgstr ""
+"`CREATE INDEX`の最初のオプションとして`plugins`を指定しなければいけないことに注意してください。`CREATE INDEX`のオプショ"
+"ンは指定された順に処理されます。指定したプラグインに含まれてるトークナイザー・ノーマライザー・トークンフィルターを使うかもしれないので、他のオプションより先"
+"にプラグインを登録しておく必要があります。"
+
+msgid ""
+"Here is an example to register `token_filters/stem` plugin to use `TokenFilter"
+"Stem` token filter:"
+msgstr "以下は`TokenFilterStem`トークンフィルターを使うために`token_filters/stem`プラグインを登録する例です。"
+
+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 (plugins='token_filters/stem',\n"
+"              token_filters='TokenFilterStem');\n"
+"```"
+msgstr ""
+
+msgid ""
+"See [How to custom token filters](#custom-token-filters) for token filters det"
+"ails."
+msgstr "トークンフィルターについては[トークンフィルターのカスタマイズ方法](#custom-token-filters)を参照してください。"
 
 msgid "#### How to custom tokenizer {#custom-tokenizer}"
 msgstr "#### トークナイザーのカスタマイズ方法 {#custom-tokenizer}"
@@ -148,14 +213,6 @@ msgstr ""
 "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"
@@ -241,6 +298,43 @@ msgstr ""
 "他のノーマライザーについては[ノーマライザー](http://groonga.org/ja/docs/reference/normalizers.html)"
 "を参照してください。"
 
+msgid "#### How to use token filters {#custom-token-filters}"
+msgstr "#### トークンフィルターのカスタマイズ方法 {#custom-token-filter}"
+
+msgid ""
+"Specify `token_filters='${TOKEN_FILTER_1}, ${TOKEN_FILTER_2}, ..., ${TOKEN_FIL"
+"TER_N}'` for using token filters."
+msgstr ""
+"トークンフィルターを使うには`token_filters='${トークンフィルター1}, ${トークンフィルター2}, ..., ${トークンフィルターN}"
+"'`を指定します。"
+
+msgid ""
+"Groonga doesn't provide any token filters by default. All token filters are pr"
+"ovided as plugins. You need to register plugins to use token filters."
+msgstr ""
+"Groongaはデフォルトでは1つもトークンフィルターを提供していません。すべてのトークンフィルターはプラグインとして提供しています。トークンフィルターを使"
+"う場合はプラグインを登録する必要があります。"
+
+msgid ""
+"Here is an example to use `TokenFilterStem` token filter that is included in `"
+"token_filters/stem` plugin:"
+msgstr "以下は`token_filters/stem`プラグインに含まれている`TokenFilterStem`トークンフィルターを使う例です。"
+
+msgid ""
+"Note that you must specify `plugins` before `token_filters`. These `CREATE IND"
+"EX` options are processed by the specified order. Plugins must be registered b"
+"efore you use token filters."
+msgstr ""
+"`token_filters`より前に`plugins`を指定しなければいけないことに注意してください。`CREATE INDEX`に指定したオプションは指"
+"定した順に処理されます。トークンフィルターを使う前にプラグインを登録しておく必要があります。"
+
+msgid ""
+"See [Token filters](http://groonga.org/docs/reference/token_filters.html) for "
+"other token filters."
+msgstr ""
+"他のトークンフィルターについては[トークンフィルター](http://groonga.org/ja/docs/reference/token_filters"
+".html)を参照してください。"
+
 msgid "#### How to change tablespace {#custom-tablespace}"
 msgstr "#### テーブルスペースの変更方法 {#custom-tablespace}"
 

  Modified: ja/reference/create-index-using-pgroonga.md (+61 -0)
===================================================================
--- ja/reference/create-index-using-pgroonga.md    2017-04-26 16:38:01 +0900 (fd328e3)
+++ ja/reference/create-index-using-pgroonga.md    2017-04-26 18:09:03 +0900 (13d0609)
@@ -40,16 +40,50 @@ CREATE INDEX ${INDEX_NAME}
 
 `CREATE INDEX`の`WITH`オプションを使って次の項目をカスタマイズできます。
 
+  * プラグイン:Groongaの拡張機能です。プラグインを登録することで追加の機能を使うことができます。追加の機能には追加のトークナイザー・ノーマライザー・トークンフィルターなどがあります。
+
   * トークナイザー:キーワードの抽出方法をカスタマイズするモジュールです。
+
   * ノーマライザー:`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/)ベースのノーマライズ方法を使います。
 
+
+#### プラグインの登録方法 {#custom-plugins}
+
+1.2.0で追加。
+
+プラグインを登録するには`plugins='${プラグイン名1}, ${プラグイン名2}, ..., ${プラグイン名N}'`を指定します。
+
+`CREATE INDEX`の最初のオプションとして`plugins`を指定しなければいけないことに注意してください。`CREATE INDEX`のオプションは指定された順に処理されます。指定したプラグインに含まれてるトークナイザー・ノーマライザー・トークンフィルターを使うかもしれないので、他のオプションより先にプラグインを登録しておく必要があります。
+
+以下は`TokenFilterStem`トークンフィルターを使うために`token_filters/stem`プラグインを登録する例です。
+
+```sql
+CREATE TABLE memos (
+  id integer,
+  content text
+);
+
+CREATE INDEX pgroonga_content_index
+          ON memos
+       USING pgroonga (content)
+        WITH (plugins='token_filters/stem',
+              token_filters='TokenFilterStem');
+```
+
+トークンフィルターについては[トークンフィルターのカスタマイズ方法](#custom-token-filters)を参照してください。
+
 #### トークナイザーのカスタマイズ方法 {#custom-tokenizer}
 
 トークナイザーをカスタマイズするには`tokenizer='${トークナイザー名}'`を指定します。通常、トークナイザーをカスタマイズする必要はありません。
@@ -110,6 +144,33 @@ CREATE INDEX pgroonga_tag_index
 
 他のノーマライザーについては[ノーマライザー](http://groonga.org/ja/docs/reference/normalizers.html)を参照してください。
 
+#### トークンフィルターのカスタマイズ方法 {#custom-token-filter}
+
+1.2.0で追加。
+
+トークンフィルターを使うには`token_filters='${トークンフィルター1}, ${トークンフィルター2}, ..., ${トークンフィルターN}'`を指定します。
+
+Groongaはデフォルトでは1つもトークンフィルターを提供していません。すべてのトークンフィルターはプラグインとして提供しています。トークンフィルターを使う場合はプラグインを登録する必要があります。
+
+以下は`token_filters/stem`プラグインに含まれている`TokenFilterStem`トークンフィルターを使う例です。
+
+```sql
+CREATE TABLE memos (
+  id integer,
+  content text
+);
+
+CREATE INDEX pgroonga_content_index
+          ON memos
+       USING pgroonga (content)
+        WITH (plugins='token_filters/stem',
+              token_filters='TokenFilterStem');
+```
+
+`token_filters`より前に`plugins`を指定しなければいけないことに注意してください。`CREATE INDEX`に指定したオプションは指定した順に処理されます。トークンフィルターを使う前にプラグインを登録しておく必要があります。
+
+他のトークンフィルターについては[トークンフィルター](http://groonga.org/ja/docs/reference/token_filters.html)を参照してください。
+
 #### テーブルスペースの変更方法 {#custom-tablespace}
 
 1.1.6で追加。

  Modified: reference/create-index-using-pgroonga.md (+62 -2)
===================================================================
--- reference/create-index-using-pgroonga.md    2017-04-26 16:38:01 +0900 (79afcc1)
+++ reference/create-index-using-pgroonga.md    2017-04-26 18:09:03 +0900 (1bf5b69)
@@ -40,16 +40,49 @@ You need to specify `pgroonga.varchar_full_text_search_ops` operator class for t
 
 You can custom the followings by `WITH` option of `CREATE INDEX`:
 
+  * Plugin: It's an extension for Groonga. You can use additional features including additional tokenizers, normalizers and token filters by registering a plugin.
+
   * Tokenizer: It's a module for customizing how to extract keywords.
+
   * Normalizer: It's a module for customizing equality of `text` and `varchar` types.
 
-Normally, you don't need to custom them because default values of them are suitable for most cases. Features to custom them are for advanced users.
+  * Token filter: It's a module for filtering keywords extracted by tokenizer.
+
+Normally, you don't need to custom them because the default values of them are suitable for most cases. Features to custom them are for advanced users.
 
-Here are default tokenizer and normalizer:
+Plugin and token filter aren't used by default.
+
+Here are the default tokenizer and normalizer:
 
   * Tokenizer: [`TokenBigram`](http://groonga.org/docs/reference/tokenizers.html#token-bigram): It's a bigram based tokenizer. It combines bigram tokenization and white space based tokenization. It uses bigram tokenization for non ASCII characters and white space based tokenization for ASCII characters. It reduces noise for ASCII characters only query.
+
   * Normalizer: [`NormalizerAuto`](http://groonga.org/docs/reference/normalizers.html#normalizer-auto): It chooses suitable normalization based on target encoding. For example, it uses [Unicode NFKC](http://unicode.org/reports/tr15/) based normalization for UTF-8.
 
+#### How to register plugins {#custom-plugins}
+
+Since 1.2.0.
+
+Specify `plugins='${PLUGIN_NAME_1}, ${PLUGIN_NAME_2}, ..., ${PLUGIN_NAME_N}'` for registering plugins.
+
+Note that you must specify `plugins` as the first option in `CREATE INDEX`. Options in `CREATE INDEX` are processed by the specified order. Plugins should be registered before other options are processed because tokenizer, normalizer and token filters may be included in the plugins.
+
+Here is an example to register `token_filters/stem` plugin to use `TokenFilterStem` token filter:
+
+```sql
+CREATE TABLE memos (
+  id integer,
+  content text
+);
+
+CREATE INDEX pgroonga_content_index
+          ON memos
+       USING pgroonga (content)
+        WITH (plugins='token_filters/stem',
+              token_filters='TokenFilterStem');
+```
+
+See [How to custom token filters](#custom-token-filters) for token filters details.
+
 #### How to custom tokenizer {#custom-tokenizer}
 
 Specify `tokenizer='${TOKENIZER_NAME}'` for customizing tokenizer. Normally, you don't need to custom tokenizer.
@@ -110,6 +143,33 @@ CREATE INDEX pgroonga_tag_index
 
 See [Normalizers](http://groonga.org/docs/reference/normalizers.html) for other normalizers.
 
+#### How to use token filters {#custom-token-filters}
+
+Since 1.2.0.
+
+Specify `token_filters='${TOKEN_FILTER_1}, ${TOKEN_FILTER_2}, ..., ${TOKEN_FILTER_N}'` for using token filters.
+
+Groonga doesn't provide any token filters by default. All token filters are provided as plugins. You need to register plugins to use token filters.
+
+Here is an example to use `TokenFilterStem` token filter that is included in `token_filters/stem` plugin:
+
+```sql
+CREATE TABLE memos (
+  id integer,
+  content text
+);
+
+CREATE INDEX pgroonga_content_index
+          ON memos
+       USING pgroonga (content)
+        WITH (plugins='token_filters/stem',
+              token_filters='TokenFilterStem');
+```
+
+Note that you must specify `plugins` before `token_filters`. These `CREATE INDEX` options are processed by the specified order. Plugins must be registered before you use token filters.
+
+See [Token filters](http://groonga.org/docs/reference/token_filters.html) for other token filters.
+
 #### How to change tablespace {#custom-tablespace}
 
 Since 1.1.6.
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る