[Groonga-commit] groonga/groonga [master] doc: add full text search and phrase search with explicit match column

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 12日 (火) 21:36:21 JST


Kouhei Sutou	2012-06-12 21:36:21 +0900 (Tue, 12 Jun 2012)

  New Revision: 9e50596b0f5fb62eaafddf6ac74ef321c6cf9115

  Log:
    doc: add full text search and phrase search with explicit match column

  Modified files:
    doc/source/spec/query_syntax.txt

  Modified: doc/source/spec/query_syntax.txt (+71 -7)
===================================================================
--- doc/source/spec/query_syntax.txt    2012-06-12 16:05:33 +0900 (324d6e1)
+++ doc/source/spec/query_syntax.txt    2012-06-12 21:36:21 +0900 (48f33ef)
@@ -95,8 +95,9 @@ Here is a simple exmaple.
 .. select Entries --match_columns content --query fast
 
 The expression matches records that contain a word ``fast`` in
-``content`` column value. ``content`` column is the default match
-column.
+``content`` column value.
+
+``content`` column is the default match column.
 
 Phrase search condition
 ^^^^^^^^^^^^^^^^^^^^^^^
@@ -126,8 +127,9 @@ Here is a simple exmaple.
 
 The expression matches records that contain a phrase ``I started`` in
 ``content`` column value. ``I also started`` isn't matched because
-``I`` and ``started`` aren't adjacent. ``content`` column is the
-default match column.
+``I`` and ``started`` aren't adjacent.
+
+``content`` column is the default match column.
 
 Equal condition
 ^^^^^^^^^^^^^^^
@@ -265,10 +267,72 @@ Here is a simple exmaple.
 The expression matches records that ``n_likes`` column value is
 greater than or equal to ``10`` from ``Entries`` table.
 
-``カラム名:@文字列``
-^^^^^^^^^^^^^^^^^^^^
+Full text search condition (with explicit match column)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Its syntax is ``column:@keyword``.
+
+It's similar to ``full text search condition`` but it doesn't require
+the default match columns. You need to specify match column for the
+full text search condition by ``column:`` instead of
+``--match_columns`` option in :doc:`/commands/select`.
+
+This condtional expression is useful when you want to use two or more
+full text search against different columns. The default match columns
+specified by ``match_columns`` option can't be specified multiple
+times. You need to specify the second match column by this conditional
+expression.
+
+The different between ``full text search condition`` and ``full text
+search condition (with explicit match column)`` is whether advanced
+match columns are supported or not. ``Full text search condition``
+supports advanced match columns but ``full text search condition (with
+explicit match column)`` isn't supported. Advanced match columns has
+the following features:
+
+  * Weight is supported.
+  * Multiple match columns are supported.
+  * Index column is supported.
+
+See description of ``--match_columns`` option in
+:doc:`/commands/select` about them.
+
+Here is a simple exmaple.
+
+.. groonga-command
+.. include:: ../example/spec/query_syntax/simple_full_text_search_with_explicit_match_column.log
+.. select Entries --query content:@fast
+
+The expression matches records that contain a word ``fast`` in
+``content`` column value.
+
+Phrase search condition (with explicit match column)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Its syntax is ``column:@"search keyword"``.
+
+It's similar to ``phrase search condition`` but it doesn't require the
+default match columns. You need to specify match column for the phrase
+search condition by ``column:`` instead of ``--match_columns`` option
+in :doc:`/commands/select`.
+
+The different between ``phrase search condition`` and ``phrase search
+condition (with explicit match column)`` is similar to between ``full
+text search condition`` and ``full text search condition (with
+explicit match column)``. ``Phrase search condition`` supports
+advanced match columns but ``phrase search condition (with explicit
+match column)`` isn't supported. See description of ``full text search
+condition (with explicit match column)`` about advanced match columns.
 
-全文検索条件(カラム値が指定された文字列を含んでいる)
+Here is a simple exmaple.
+
+.. groonga-command
+.. include:: ../example/spec/query_syntax/simple_phrase_search_with_explicit_match_column.log
+.. select Entries --query 'content:@"I started"'
+
+The expression matches records that contain a phrase ``I started`` in
+``content`` column value. ``I also started`` isn't matched because
+``I`` and ``started`` aren't adjacent.
 
 Combined expression
 -------------------




Groonga-commit メーリングリストの案内
Back to archive index