[Groonga-commit] groonga/groonga [master] doc: update for renaming --query_expansion to --query_expander

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Mar 19 19:09:23 JST 2013


Kouhei Sutou	2013-03-19 19:09:23 +0900 (Tue, 19 Mar 2013)

  New Revision: 7d9e7c004b0d591cb27b6e1aab40841f81d6cdd6
  https://github.com/groonga/groonga/commit/7d9e7c004b0d591cb27b6e1aab40841f81d6cdd6

  Message:
    doc: update for renaming --query_expansion to --query_expander
    
    TODO: .po should be updated in release process for this month. :p
    
    (Renamed files are also included!)

  Modified files:
    doc/files.am
    doc/source/example/tutorial/query_expansion-3.log
    doc/source/reference/commands/select.txt
    doc/source/tutorial/query_expansion.txt
  Renamed files:
    doc/source/example/reference/commands/select/query_expander_complex.log
      (from doc/source/example/reference/commands/select/query_expansion_complex.log)
    doc/source/example/reference/commands/select/query_expander_substitute.log
      (from doc/source/example/reference/commands/select/query_expansion_substitute.log)
    doc/source/example/reference/commands/select/query_expander_substitution_table.log
      (from doc/source/example/reference/commands/select/query_expansion_substitution_table.log)

  Modified: doc/files.am (+6 -6)
===================================================================
--- doc/files.am    2013-03-19 19:05:18 +0900 (1b5e45c)
+++ doc/files.am    2013-03-19 19:09:23 +0900 (098e0de)
@@ -38,9 +38,9 @@ absolute_source_files = \
 	$(top_srcdir)/doc/source/example/reference/commands/select/paging.log \
 	$(top_srcdir)/doc/source/example/reference/commands/select/query_and.log \
 	$(top_srcdir)/doc/source/example/reference/commands/select/query_equal.log \
-	$(top_srcdir)/doc/source/example/reference/commands/select/query_expansion_complex.log \
-	$(top_srcdir)/doc/source/example/reference/commands/select/query_expansion_substitute.log \
-	$(top_srcdir)/doc/source/example/reference/commands/select/query_expansion_substitution_table.log \
+	$(top_srcdir)/doc/source/example/reference/commands/select/query_expander_complex.log \
+	$(top_srcdir)/doc/source/example/reference/commands/select/query_expander_substitute.log \
+	$(top_srcdir)/doc/source/example/reference/commands/select/query_expander_substitution_table.log \
 	$(top_srcdir)/doc/source/example/reference/commands/select/query_flags_allow_column.log \
 	$(top_srcdir)/doc/source/example/reference/commands/select/query_flags_allow_leading_not.log \
 	$(top_srcdir)/doc/source/example/reference/commands/select/query_flags_allow_update.log \
@@ -472,9 +472,9 @@ source_files_relative_from_doc_dir = \
 	source/example/reference/commands/select/paging.log \
 	source/example/reference/commands/select/query_and.log \
 	source/example/reference/commands/select/query_equal.log \
-	source/example/reference/commands/select/query_expansion_complex.log \
-	source/example/reference/commands/select/query_expansion_substitute.log \
-	source/example/reference/commands/select/query_expansion_substitution_table.log \
+	source/example/reference/commands/select/query_expander_complex.log \
+	source/example/reference/commands/select/query_expander_substitute.log \
+	source/example/reference/commands/select/query_expander_substitution_table.log \
 	source/example/reference/commands/select/query_flags_allow_column.log \
 	source/example/reference/commands/select/query_flags_allow_leading_not.log \
 	source/example/reference/commands/select/query_flags_allow_update.log \

  Renamed: doc/source/example/reference/commands/select/query_expander_complex.log (+1 -1) 97%
===================================================================
--- doc/source/example/reference/commands/select/query_expansion_complex.log    2013-03-19 19:05:18 +0900 (c60dd7b)
+++ doc/source/example/reference/commands/select/query_expander_complex.log    2013-03-19 19:09:23 +0900 (5b19851)
@@ -5,7 +5,7 @@ Execution example::
   {"_key": "popular", "synonym": ["popular", "n_likes:>=10"]}
   ]
   # [[0, 1337566253.89858, 0.000355720520019531], 1]
-  select Entries --match_columns content --query "popular" --query_expansion Thesaurus.synonym
+  select Entries --match_columns content --query "popular" --query_expander Thesaurus.synonym
   # [
   #   [
   #     0, 

  Renamed: doc/source/example/reference/commands/select/query_expander_substitute.log (+1 -1) 98%
===================================================================
--- doc/source/example/reference/commands/select/query_expansion_substitute.log    2013-03-19 19:05:18 +0900 (fa0e65b)
+++ doc/source/example/reference/commands/select/query_expander_substitute.log    2013-03-19 19:09:23 +0900 (197f4dd)
@@ -39,7 +39,7 @@ Execution example::
   #     ]
   #   ]
   # ]
-  select Entries --match_columns content --query "mroonga" --query_expansion Thesaurus.synonym
+  select Entries --match_columns content --query "mroonga" --query_expander Thesaurus.synonym
   # [
   #   [
   #     0, 

  Renamed: doc/source/example/reference/commands/select/query_expander_substitution_table.log (+0 -0) 100%
===================================================================

  Modified: doc/source/example/tutorial/query_expansion-3.log (+2 -2)
===================================================================
--- doc/source/example/tutorial/query_expansion-3.log    2013-03-19 19:05:18 +0900 (def84e6)
+++ doc/source/example/tutorial/query_expansion-3.log    2013-03-19 19:09:23 +0900 (96ecb8d)
@@ -1,6 +1,6 @@
 Execution example::
 
-  select Doc --match_columns body --query "シークァーサー" --query_expansion Synonym.body
+  select Doc --match_columns body --query "シークァーサー" --query_expander Synonym.body
   # [
   #   [
   #     0, 
@@ -39,7 +39,7 @@ Execution example::
   #     ]
   #   ]
   # ]
-  select Doc --match_columns body --query "シークヮーサー" --query_expansion Synonym.body
+  select Doc --match_columns body --query "シークヮーサー" --query_expander Synonym.body
   # [
   #   [
   #     0, 

  Modified: doc/source/reference/commands/select.txt (+98 -89)
===================================================================
--- doc/source/reference/commands/select.txt    2013-03-19 19:05:18 +0900 (2043463)
+++ doc/source/reference/commands/select.txt    2013-03-19 19:09:23 +0900 (da02cb3)
@@ -41,6 +41,7 @@ Syntax
          [match_escalation_threshold=0]
          [query_expansion=null]
          [query_flags=ALLOW_PRAGMA|ALLOW_COLUMN|ALLOW_UPDATE|ALLOW_LEADING_NOT|NONE]
+         [query_expander=null]
 
 Usage
 -----
@@ -451,95 +452,7 @@ more searches aren't executed. And no records are matched.
 ``query_expansion``
 """""""""""""""""""
 
-It's for query expansion. Query expansion substitutes specific words
-to another words in query. Nomally, it's used for synonym search.
-
-It specifies a column that is used to substitute ``query`` parameter
-value. The format of this parameter value is
-"``${TABLE}.${COLUMN}``". For example, "``Terms.synonym``" specifies
-``synonym`` column in ``Terms`` table.
-
-Table for query expansion is called "substitution table". Substitution
-table's key must be ``ShortText``. So array table (``TABLE_NO_KEY``)
-can't be used for query expansion. Because array table doesn't have
-key.
-
-Column for query expansion is called "substitution
-column". Substitution column's value type must be
-``ShortText``. Column type must be vector (``COLUMN_VECTOR``).
-
-Query expansion substitutes key of substitution table in query with
-values in substitution column. If a word in ``query`` is a key of
-substitution table, the word is substituted with substitution column
-value that is associated with the key. Substition isn't performed
-recursively. It means that substitution target words in substituted
-query aren't substituted.
-
-Here is a sample substitution table to show a simple
-``query_expansion`` usage example.
-
-.. groonga-command
-.. include:: ../../example/reference/commands/select/query_expansion_substitution_table.log
-.. table_create Thesaurus TABLE_PAT_KEY|KEY_NORMALIZE ShortText
-.. column_create Thesaurus synonym COLUMN_VECTOR ShortText
-.. load --table Thesaurus
-.. [
-.. {"_key": "mroonga", "synonym": ["mroonga", "tritonn", "groonga mysql"]},
-.. {"_key": "groonga", "synonym": ["groonga", "senna"]}
-.. ]
-
-``Thesaurus`` substitution table has two synonyms, ``"mroonga"`` and
-``"groonga"``. If an user searches with ``"mroonga"``, groonga
-searches with ``"((mroonga) OR (tritonn) OR (groonga mysql))"``. If an
-user searches with ``"groonga"``, groonga searchs with ``"((groonga)
-OR (senna))"``. Nomrally, it's good idea that substitution table has
-``KEY_NORMALIZE`` flag. If the flag is used, substitute target word is
-matched in case insensitive manner.
-
-Note that those synonym values include the key value such as
-``"mroonga"`` and ``"groonga"``. It's recommended that you include the
-key value. If you don't include key value, substituted value doesn't
-include the original substitute target value. Normally, including the
-original value is better search result. If you have a word that you
-don't want to be searched, you should not include the original
-word. For example, you can implement "stop words" by an empty vector
-value.
-
-Here is a simple ``query_expansion`` usage example.
-
-.. groonga-command
-.. include:: ../../example/reference/commands/select/query_expansion_substitute.log
-.. select Entries --match_columns content --query "mroonga"
-.. select Entries --match_columns content --query "mroonga" --query_expansion Thesaurus.synonym
-.. select Entries --match_columns content --query "((mroonga) OR (tritonn) OR (groonga mysql))"
-
-The first ``select`` command doesn't use query expansion. So a record
-that has ``"tritonn"`` isn't found. The second ``select`` command uses
-query expansion. So a record that has ``"tritonn"`` is found. The
-third ``select`` command doesn't use query expansion but it is same as
-the second ``select`` command. The third one uses expanded query.
-
-Each substitute value can contain any :doc:`/reference/grn_expr/query_syntax` syntax
-such as ``(...)`` and ``OR``. You can use complex substitution by
-using those syntax.
-
-Here is a complex substitution usage example that uses query syntax.
-
-.. groonga-command
-.. include:: ../../example/reference/commands/select/query_expansion_complex.log
-.. load --table Thesaurus
-.. [
-.. {"_key": "popular", "synonym": ["popular", "n_likes:>=10"]}
-.. ]
-.. select Entries --match_columns content --query "popular" --query_expansion Thesaurus.synonym
-
-The ``load`` command registers a new synonym ``"popular"``. It is
-substituted with ``((popular) OR (n_likes:>=10))``. The substituted
-query means that "popular" is containing the word "popular" or 10 or
-more liked entries.
-
-The ``select`` command outputs records that ``n_likes`` column value
-is equal to or more than ``10`` from ``Entries`` table.
+Deprecated. Use :ref:`query-expander` instead.
 
 .. _query-flags:
 
@@ -633,6 +546,102 @@ specified.
 
 See also :doc:`/reference/grn_expr/query_syntax`.
 
+.. _query-expander:
+
+``query_expander``
+""""""""""""""""""
+
+It's for query expansion. Query expansion substitutes specific words
+to another words in query. Nomally, it's used for synonym search.
+
+It specifies a column that is used to substitute ``query`` parameter
+value. The format of this parameter value is
+"``${TABLE}.${COLUMN}``". For example, "``Terms.synonym``" specifies
+``synonym`` column in ``Terms`` table.
+
+Table for query expansion is called "substitution table". Substitution
+table's key must be ``ShortText``. So array table (``TABLE_NO_KEY``)
+can't be used for query expansion. Because array table doesn't have
+key.
+
+Column for query expansion is called "substitution
+column". Substitution column's value type must be
+``ShortText``. Column type must be vector (``COLUMN_VECTOR``).
+
+Query expansion substitutes key of substitution table in query with
+values in substitution column. If a word in ``query`` is a key of
+substitution table, the word is substituted with substitution column
+value that is associated with the key. Substition isn't performed
+recursively. It means that substitution target words in substituted
+query aren't substituted.
+
+Here is a sample substitution table to show a simple
+``query_expander`` usage example.
+
+.. groonga-command
+.. include:: ../../example/reference/commands/select/query_expander_substitution_table.log
+.. table_create Thesaurus TABLE_PAT_KEY|KEY_NORMALIZE ShortText
+.. column_create Thesaurus synonym COLUMN_VECTOR ShortText
+.. load --table Thesaurus
+.. [
+.. {"_key": "mroonga", "synonym": ["mroonga", "tritonn", "groonga mysql"]},
+.. {"_key": "groonga", "synonym": ["groonga", "senna"]}
+.. ]
+
+``Thesaurus`` substitution table has two synonyms, ``"mroonga"`` and
+``"groonga"``. If an user searches with ``"mroonga"``, groonga
+searches with ``"((mroonga) OR (tritonn) OR (groonga mysql))"``. If an
+user searches with ``"groonga"``, groonga searchs with ``"((groonga)
+OR (senna))"``. Nomrally, it's good idea that substitution table has
+``KEY_NORMALIZE`` flag. If the flag is used, substitute target word is
+matched in case insensitive manner.
+
+Note that those synonym values include the key value such as
+``"mroonga"`` and ``"groonga"``. It's recommended that you include the
+key value. If you don't include key value, substituted value doesn't
+include the original substitute target value. Normally, including the
+original value is better search result. If you have a word that you
+don't want to be searched, you should not include the original
+word. For example, you can implement "stop words" by an empty vector
+value.
+
+Here is a simple ``query_expander`` usage example.
+
+.. groonga-command
+.. include:: ../../example/reference/commands/select/query_expander_substitute.log
+.. select Entries --match_columns content --query "mroonga"
+.. select Entries --match_columns content --query "mroonga" --query_expander Thesaurus.synonym
+.. select Entries --match_columns content --query "((mroonga) OR (tritonn) OR (groonga mysql))"
+
+The first ``select`` command doesn't use query expansion. So a record
+that has ``"tritonn"`` isn't found. The second ``select`` command uses
+query expansion. So a record that has ``"tritonn"`` is found. The
+third ``select`` command doesn't use query expansion but it is same as
+the second ``select`` command. The third one uses expanded query.
+
+Each substitute value can contain any :doc:`/reference/grn_expr/query_syntax` syntax
+such as ``(...)`` and ``OR``. You can use complex substitution by
+using those syntax.
+
+Here is a complex substitution usage example that uses query syntax.
+
+.. groonga-command
+.. include:: ../../example/reference/commands/select/query_expander_complex.log
+.. load --table Thesaurus
+.. [
+.. {"_key": "popular", "synonym": ["popular", "n_likes:>=10"]}
+.. ]
+.. select Entries --match_columns content --query "popular" --query_expander Thesaurus.synonym
+
+The ``load`` command registers a new synonym ``"popular"``. It is
+substituted with ``((popular) OR (n_likes:>=10))``. The substituted
+query means that "popular" is containing the word "popular" or 10 or
+more liked entries.
+
+The ``select`` command outputs records that ``n_likes`` column value
+is equal to or more than ``10`` from ``Entries`` table.
+
+
 Output related parameters
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 

  Modified: doc/source/tutorial/query_expansion.txt (+5 -5)
===================================================================
--- doc/source/tutorial/query_expansion.txt    2013-03-19 19:05:18 +0900 (42dfdf4)
+++ doc/source/tutorial/query_expansion.txt    2013-03-19 19:09:23 +0900 (4411dd6)
@@ -8,7 +8,7 @@
 クエリ拡張
 ==========
 
-groongaでは、 :doc:`/reference/commands/select` コマンドにquery_expansionパラメータを指定することによって、ユーザが指定した検索文字列を適宜拡張することが可能です。
+groongaでは、 :doc:`/reference/commands/select` コマンドにquery_expanderパラメータを指定することによって、ユーザが指定した検索文字列を適宜拡張することが可能です。
 
 たとえば、ユーザが'シークヮーサー'という文字列で検索した場合に、'シークヮーサー OR シークァーサー'で検索した場合と同一の結果を返すことによって、本来ユーザが必要とする結果をよりもれなく検索できるようになります。
 
@@ -45,18 +45,18 @@ TODO: 文字列型のベクターカラムでも可能であり、その場合
 検索
 ----
 
-それでは実際に、準備した置換テーブルを使ってみましょう。まずは、query_expansionパラメータを指定せずにselectコマンドを使って検索してみます。
+それでは実際に、準備した置換テーブルを使ってみましょう。まずは、query_expanderパラメータを指定せずにselectコマンドを使って検索してみます。
 
 .. groonga-command
 .. include:: ../example/tutorial/query_expansion-2.log
 .. select Doc --match_columns body --query "シークァーサー"
 .. select Doc --match_columns body --query "シークヮーサー"
 
-指定された文字列に完全に一致するレコードのみがそれぞれヒットします。次に、query_expansionパラメータに、準備したSynonymテーブルのbodyカラムを指定してみましょう。
+指定された文字列に完全に一致するレコードのみがそれぞれヒットします。次に、query_expanderパラメータに、準備したSynonymテーブルのbodyカラムを指定してみましょう。
 
 .. groonga-command
 .. include:: ../example/tutorial/query_expansion-3.log
-.. select Doc --match_columns body --query "シークァーサー" --query_expansion Synonym.body
-.. select Doc --match_columns body --query "シークヮーサー" --query_expansion Synonym.body
+.. select Doc --match_columns body --query "シークァーサー" --query_expander Synonym.body
+.. select Doc --match_columns body --query "シークヮーサー" --query_expander Synonym.body
 
 どちらのクエリ文字列も、"(シークァーサー OR シークヮーサー)"という文字列に置換されてから検索されるため、表記の揺れを吸収して検索できるようになりました。
-------------- next part --------------
HTML����������������������������...
下載 



More information about the Groonga-commit mailing list
Back to archive index