Navigation Menu

Skip to content

Commit

Permalink
doc in_records: add
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 19, 2017
1 parent 9d89e2c commit 693f167
Show file tree
Hide file tree
Showing 8 changed files with 499 additions and 4 deletions.
12 changes: 12 additions & 0 deletions doc/files.am
Expand Up @@ -358,6 +358,10 @@ absolute_source_files = \
$(top_srcdir)/doc/source/example/reference/functions/html_untag/usage_html_untag.log \
$(top_srcdir)/doc/source/example/reference/functions/html_untag/usage_setup_data.log \
$(top_srcdir)/doc/source/example/reference/functions/html_untag/usage_setup_schema.log \
$(top_srcdir)/doc/source/example/reference/functions/in_records/usage_search.log \
$(top_srcdir)/doc/source/example/reference/functions/in_records/usage_setup_conditions.log \
$(top_srcdir)/doc/source/example/reference/functions/in_records/usage_setup_data.log \
$(top_srcdir)/doc/source/example/reference/functions/in_records/usage_setup_schema.log \
$(top_srcdir)/doc/source/example/reference/functions/in_values/usage_only.log \
$(top_srcdir)/doc/source/example/reference/functions/in_values/usage_setup_data.log \
$(top_srcdir)/doc/source/example/reference/functions/in_values/usage_setup_schema.log \
Expand Down Expand Up @@ -818,6 +822,7 @@ absolute_source_files = \
$(top_srcdir)/doc/source/reference/functions/highlight_full.rst \
$(top_srcdir)/doc/source/reference/functions/highlight_html.rst \
$(top_srcdir)/doc/source/reference/functions/html_untag.rst \
$(top_srcdir)/doc/source/reference/functions/in_records.rst \
$(top_srcdir)/doc/source/reference/functions/in_values.rst \
$(top_srcdir)/doc/source/reference/functions/now.rst \
$(top_srcdir)/doc/source/reference/functions/number_classify.rst \
Expand Down Expand Up @@ -1269,6 +1274,10 @@ source_files_relative_from_doc_dir = \
source/example/reference/functions/html_untag/usage_html_untag.log \
source/example/reference/functions/html_untag/usage_setup_data.log \
source/example/reference/functions/html_untag/usage_setup_schema.log \
source/example/reference/functions/in_records/usage_search.log \
source/example/reference/functions/in_records/usage_setup_conditions.log \
source/example/reference/functions/in_records/usage_setup_data.log \
source/example/reference/functions/in_records/usage_setup_schema.log \
source/example/reference/functions/in_values/usage_only.log \
source/example/reference/functions/in_values/usage_setup_data.log \
source/example/reference/functions/in_values/usage_setup_schema.log \
Expand Down Expand Up @@ -1729,6 +1738,7 @@ source_files_relative_from_doc_dir = \
source/reference/functions/highlight_full.rst \
source/reference/functions/highlight_html.rst \
source/reference/functions/html_untag.rst \
source/reference/functions/in_records.rst \
source/reference/functions/in_values.rst \
source/reference/functions/now.rst \
source/reference/functions/number_classify.rst \
Expand Down Expand Up @@ -2101,6 +2111,7 @@ html_files_relative_from_locale_dir = \
html/_sources/reference/functions/highlight_full.txt \
html/_sources/reference/functions/highlight_html.txt \
html/_sources/reference/functions/html_untag.txt \
html/_sources/reference/functions/in_records.txt \
html/_sources/reference/functions/in_values.txt \
html/_sources/reference/functions/now.txt \
html/_sources/reference/functions/number_classify.txt \
Expand Down Expand Up @@ -2373,6 +2384,7 @@ html_files_relative_from_locale_dir = \
html/reference/functions/highlight_full.html \
html/reference/functions/highlight_html.html \
html/reference/functions/html_untag.html \
html/reference/functions/in_records.html \
html/reference/functions/in_values.html \
html/reference/functions/now.html \
html/reference/functions/number_classify.html \
Expand Down
207 changes: 203 additions & 4 deletions doc/locale/ja/LC_MESSAGES/reference.po
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.2.1\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2017-04-10 14:49+0900\n"
"PO-Revision-Date: 2017-04-19 18:14+0900\n"
"Last-Translator: Masafumi Yokoyama <yokoyama@clear-code.com>\n"
"Language-Team: Japanese\n"
"Language: ja\n"
Expand Down Expand Up @@ -19363,6 +19363,208 @@ msgstr ""
"``html_untag`` はHTMLテキストからHTMLタグを除去したタグなしのテキストを返しま"
"す。"

msgid "``in_records``"
msgstr ""

msgid ""
"You can use ``in_records`` for using an existing table as condition "
"patterns. Each record in the existing table is treated as a condition "
"pattern."
msgstr ""
"``in_records`` を使うと既存のテーブルを条件のパターンとして使うことができま"
"す。テーブル内の各レコードがそれぞれ条件のパターンになります。"

msgid ""
"You may be able to reduce multiple queries to only one query by "
"``in_records``."
msgstr ""
"``in_records`` を使うと複数のクエリーを1つのクエリーにできるかもしれません。"

msgid ""
"``in_records`` is similar to :doc:`sub_filter`. Here are differences of them:"
msgstr ""
"``in_records`` は :doc:`sub_filter` に似ています。2つの違いは次の通りです。"

msgid ""
"``sub_filter`` requires a reference column to condition table but "
"``in_records`` doesn't require."
msgstr ""
"``sub_filter`` では条件テーブルを参照するカラムが必須ですが、 ``in_records`` "
"では必要ありません。"

msgid ""
"``sub_filter`` requires an index column for the reference column but "
"``in_records`` doesn't require."
msgstr ""
"``sub_filter`` では上述の参照カラム用のインデックスカラムが必須ですが、 "
"``in_records`` ではインデックスカラムは必要ありません。"

msgid ""
"``sub_filter`` can use all logical operations but ``in_records`` can use "
"only AND logical operation in one pattern."
msgstr ""
"``sub_filter`` ではすべての論理演算を使えますが、 ``in_records`` では1つのパ"
"ターン内でAND論理演算しか使えません。"

msgid ""
"``sub_filter`` can use only the value of one reference column for condition "
"but ``in_records`` can use one or more values for condition. You can use "
"multiple columns, functions and so on for multiple values."
msgstr ""
"``sub_filter`` では条件に1つの参照カラムの値しか使えませんが、 "
"``in_records`` では条件に1つ以上の値を使えます。複数の値を指定するために複数"
"のカラムや関数などを使えます。"

msgid ""
"``sub_filter`` uses index search but ``in_records`` uses sequential search."
msgstr ""
"``sub_filter`` ではインデックスサーチを使いますが、 ``in_records`` ではシーケ"
"ンシャルサーチを使います。"

msgid "``in_records`` has four or more parameters::"
msgstr "``in_records`` には4つ以上のパラメーターがあります。::"

msgid "Here is a schema definition and sample data."
msgstr "使い方を示すために使うスキーマ定義とサンプルデータは以下の通りです。"

msgid "Sample conditions:"
msgstr "サンプル条件:"

msgid ""
"Here is a simple usage of ``in_records`` that searches by records in "
"``Conditions`` table. Each record is used as a condition:"
msgstr ""
"以下は ``Conditions`` テーブル内のレコードで検索をする ``in_records`` の使用"
"例です。各レコードを条件として使います。"

msgid "The ``filter`` tries the following three conditions for each record:"
msgstr "この ``filter`` は各レコードに対して次の3つの条件で絞り込みます。"

msgid "``Memos.user`` matches (``@``) ``Conditions.user_pattern``."
msgstr ""
"``Memos.user`` が ``Conditions.user_pattern`` にマッチ( ``@`` )するか。"

msgid "``Memos.tag`` equals (``==``) ``Conditions.tag``."
msgstr "``Memos.tag`` は ``Conditions.tag`` と等しい( ``==`` )か。"

msgid ""
"The number of characters in ``Memos._key`` is less than or equals to "
"``Conditions.max_length``."
msgstr "``Memos._key`` の文字数が ``Conditions.max_length`` 以下か。"

msgid ""
"If at least one record in ``Conditions`` table returns true for the all "
"three conditions, the record in ``Memos`` is matched."
msgstr ""
"``Conditions`` テーブル内の少なくとも1つのレコードがこれら3つの条件すべてで真"
"を返せば ``Memos`` テーブルのそのレコードはマッチします。"

msgid "The first record in ``Conditions`` table use the following conditions:"
msgstr "``Conditions`` テーブルの最初のレコードは次の条件を使います。"

msgid "``Memos.user`` has ``\"lic\"`` substring."
msgstr "``Memos.user`` には部分文字列として ``\"lic\"`` がある。"

msgid "``Memos.tag`` is ``\"groonga\"``."
msgstr "``Memos.tag`` は ``\"groonga\"`` である。"

msgid ""
"The number of characters in ``Memos._key`` is less than or equals to ``20``."
msgstr "``Memos._key`` の文字数が ``20`` 以下である。"

msgid "This condition matches the following records:"
msgstr "この条件は次のレコードにマッチします。"

msgid ""
"``{\"_key\": \"Groonga is fast\", \"user\": \"alice\", \"tag\": \"groonga\"}"
"``"
msgstr ""

msgid "The second record in ``Conditions`` table use the following conditions:"
msgstr "``Conditions`` テーブルの2つめのレコードは次の条件を使います。"

msgid "``Memos.user`` has ``\"dav\"`` substring."
msgstr "``Memos.user`` には部分文字列として ``\"dav\"`` がある。"

msgid "``Memos.tag`` is ``\"droonga\"``."
msgstr "``Memos.tag`` は ``\"droonga\"`` である。"

msgid ""
"The number of characters in ``Memos._key`` is less than or equals to ``50``."
msgstr "``Memos._key`` の文字数が ``50`` 以下である。"

msgid ""
"``{\"_key\": \"Droonga is fast\", \"user\": \"david\", \"tag\": \"droonga\"}"
"``"
msgstr ""

msgid "The result has the all above records."
msgstr "検索結果には前述のすべてのレコードが含まれます。"

msgid "``in_records`` requires four or more parameters."
msgstr "``in_records`` には4つ以上のパラメーターが必須です。"

msgid ""
"``condition_table`` and tuples of ``value``, ``mode_name`` and "
"``condition_column_name`` are required. You can specify multiple tuples of "
"``value``, ``mode_name`` and ``condition_column_name``"
msgstr ""
"``condition_table`` と「 ``value`` 、 ``mode_name`` 、 "
"``condition_column_name`` 」のセットです。「 ``value`` 、 ``mode_name`` 、 "
"``condition_column_name`` 」のセットは複数回指定できます。"

msgid "``condition_table``"
msgstr ""

msgid "Specifies a table that has conditions as its records."
msgstr "レコードとして条件が入っているテーブルを指定します。"

msgid "Specifies a value to be compared."
msgstr "比較対象の値を指定します。"

msgid "``mode_name``"
msgstr ""

msgid ""
"Specifies a mode name that specifies how to compare :ref:`in-records-value` "
"with a value of :ref:`in-records-condition-column-name`."
msgstr ""
":ref:`in-records-value` と :ref:`in-records-condition-column-name` の値の比較"
"方法(モード名)を指定します。"

msgid ""
"See :ref:`query-default-mode` for available mode names. All mode names "
"except ``NEAR``, ``SIMILAR`` and ``SUFFIX`` are supported."
msgstr ""
"利用可能なモード名は :ref:`query-default-mode` を見てください。 ``NEAR`` 、 "
"``SIMILAR`` と ``SUFFIX`` 以外のすべてのモード名をサポートしています。"

msgid "``condition_column_name``"
msgstr ""

msgid ""
"Specifies a column name of :ref:`in-records-condition-table` to be used as "
"condition."
msgstr ""
"条件として使う :ref:`in-records-condition-table` のカラム名を指定します。"

msgid "There are no optional parameter."
msgstr "省略可能な引数はありません。"

msgid ""
"``in_records`` returns whether the record is matched one of records of the "
"specified condition table or not."
msgstr ""
"``in_records`` は対象レコードが指定した条件テーブル内の1つ以上のレコード(パ"
"ターン)にマッチするかどうかを返します。"

msgid ""
"If the record is matched, it returns ``true``. Otherwise, it returns "
"``false``."
msgstr ""
"もし該当レコードがマッチすれば、 ``true`` を返します。そうでなければ "
"``false`` を返します。"

msgid "``in_values``"
msgstr ""

Expand All @@ -19381,9 +19583,6 @@ msgid ""
msgstr ""
"``query`` は2以上の引数 - ``target_value`` と 複数の ``value`` が必要です。"

msgid "Here is a schema definition and sample data."
msgstr "使い方を示すために使うスキーマ定義とサンプルデータは以下の通りです。"

msgid ""
"Here is the simple usage of ``in_values`` function which selects the records "
"- the value of ``tag`` column is \"groonga\" or \"mroonga\" or \"droonga\"."
Expand Down
50 changes: 50 additions & 0 deletions doc/source/example/reference/functions/in_records/usage_search.log
@@ -0,0 +1,50 @@
Execution example::

plugin_register functions/string
# [[0, 1337566253.89858, 0.000355720520019531], true]
select \
--table Memos \
--filter 'in_records(Conditions, \
user, "@", "user_pattern", \
tag, "==", "tag", \
string_length(_key), "<=", "max_length")' \
--sort_by _id \
--output_columns _key,user,tag
# [
# [
# 0,
# 1337566253.89858,
# 0.000355720520019531
# ],
# [
# [
# [
# 2
# ],
# [
# [
# "_key",
# "ShortText"
# ],
# [
# "user",
# "ShortText"
# ],
# [
# "tag",
# "Tags"
# ]
# ],
# [
# "Groonga is fast",
# "alice",
# "groonga"
# ],
# [
# "Droonga is fast",
# "david",
# "droonga"
# ]
# ]
# ]
# ]
@@ -0,0 +1,8 @@
Execution example::

load --table Conditions
[
{"_key": "lic + groonga", "user_pattern": "lic", "tag": "groonga", max_length: 20},
{"_key": "dav + droonga", "user_pattern": "dav", "tag": "droonga", max_length: 50}
]
# [[0, 1337566253.89858, 0.000355720520019531], 2]
@@ -0,0 +1,11 @@
Execution example::

load --table Memos
[
{"_key": "Groonga is fast", "user": "alice", "tag": "groonga"},
{"_key": "Mroonga is fast", "user": "alice", "tag": "mroonga"},
{"_key": "Groonga is very good!", "user": "alice", "tag": "groonga"},
{"_key": "Droonga is fast", "user": "david", "tag": "droonga"},
{"_key": "Groonga is a HTTP server", "user": "david", "tag": "groonga"}
]
# [[0, 1337566253.89858, 0.000355720520019531], 5]
@@ -0,0 +1,18 @@
Execution example::

table_create Tags TABLE_PAT_KEY ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create Conditions TABLE_PAT_KEY ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Conditions user_pattern COLUMN_SCALAR ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Conditions tag COLUMN_SCALAR Tags
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Conditions max_length COLUMN_SCALAR UInt32
# [[0, 1337566253.89858, 0.000355720520019531], true]
table_create Memos TABLE_HASH_KEY ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Memos user COLUMN_SCALAR ShortText
# [[0, 1337566253.89858, 0.000355720520019531], true]
column_create Memos tag COLUMN_SCALAR Tags
# [[0, 1337566253.89858, 0.000355720520019531], true]

0 comments on commit 693f167

Please sign in to comment.