[Groonga-commit] groonga/groonga [master] [doc][suggest] add about suggestion.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 8月 11日 (木) 10:01:45 JST


Kouhei Sutou	2011-08-11 01:01:45 +0000 (Thu, 11 Aug 2011)

  New Revision: a2b298c1be2deac76dbffe91a3735898e46bedb8

  Log:
    [doc][suggest] add about suggestion.

  Added files:
    doc/source/suggest/suggestion.txt
  Modified files:
    doc/source/suggest/completion.txt
    doc/source/suggest/correction.txt

  Modified: doc/source/suggest/completion.txt (+3 -3)
===================================================================
--- doc/source/suggest/completion.txt    2011-08-10 15:46:36 +0000 (fa5d664)
+++ doc/source/suggest/completion.txt    2011-08-11 01:01:45 +0000 (a214e67)
@@ -3,7 +3,7 @@
 .. highlightlang:: none
 
 .. groonga-command
-.. % rm -rf /tmp/completion/db
+.. % rm -rf /tmp/completion
 .. % mkdir -p /tmp/completion
 .. % groonga -n /tmp/completion/db shutdown
 .. % groonga-suggest-create-dataset /tmp/completion/db query
@@ -11,8 +11,8 @@
 Completion
 ==========
 
-This section describes about the following of the completion
-feature:
+This section describes about the following completion
+features:
 
   * How it works
   * How to use

  Modified: doc/source/suggest/correction.txt (+4 -4)
===================================================================
--- doc/source/suggest/correction.txt    2011-08-10 15:46:36 +0000 (34bbb98)
+++ doc/source/suggest/correction.txt    2011-08-11 01:01:45 +0000 (ca361c5)
@@ -3,7 +3,7 @@
 .. highlightlang:: none
 
 .. groonga-command
-.. % rm -rf /tmp/correction/db
+.. % rm -rf /tmp/correction
 .. % mkdir -p /tmp/correction
 .. % groonga -n /tmp/correction/db shutdown
 .. % groonga-suggest-create-dataset /tmp/correction/db query
@@ -11,8 +11,8 @@
 Correction
 ==========
 
-This section describes about the following of the correction
-feature:
+This section describes about the following correction
+features:
 
   * How it works
   * How to use
@@ -34,7 +34,7 @@ Cooccurrence search can find registered words from user's
 wrong input. It uses user submit sequences that will be
 learned from query logs, access logs and so on.
 
-For example, there is the following user submissions:
+For example, there are the following user submissions:
 
 +-------------------+---------------------------+
 |  query            |    time                   |

  Added: doc/source/suggest/suggestion.txt (+117 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/suggest/suggestion.txt    2011-08-11 01:01:45 +0000 (bf39d8a)
@@ -0,0 +1,117 @@
+.. -*- rst -*-
+
+.. highlightlang:: none
+
+.. groonga-command
+.. % rm -rf /tmp/suggestion
+.. % mkdir -p /tmp/suggestion
+.. % groonga -n /tmp/suggestion/db shutdown
+.. % groonga-suggest-create-dataset /tmp/suggestion/db query
+
+Suggestion
+==========
+
+This section describes about the following completion
+features:
+
+  * How it works
+  * How to use
+  * How to learn
+
+How it works
+------------
+
+The suggestion feature uses a search to compute suggested
+words:
+
+  1. Cooccurrence search against learned data.
+
+Cooccurrence search
+^^^^^^^^^^^^^^^^^^^
+
+Cooccurrence search can find related words from user's
+input. It uses user submissions that will be learned
+from query logs, access logs and so on.
+
+For example, there are the following user submissions:
+
++----------------------+
+|  query               |
++======================+
+| search engine        |
++----------------------+
+| web search realtime  |
++----------------------+
+
+Groonga creates the following suggestion pairs:
+
++----------+------------------------------------+
+|  input   |          suggested words           |
++----------+------------------------------------+
+|search    |search engine                       |
++----------+------------------------------------+
+|engine    |search engine                       |
++----------+------------------------------------+
+|web       |web search realtime                 |
++----------+------------------------------------+
+|search    |web search realtime                 |
++----------+------------------------------------+
+|realtime  |web search realtime                 |
++----------+------------------------------------+
+
+Those pairs are created by the following steps:
+
+  1. Tokenizes user input query by TokenDelimit tokenizer
+     that uses a space as token delimiter. (e.g. "search
+     engine" is tokenized to two tokens "search" and
+     "engine".)
+  2. Creates a pair that is consists of a token and original
+     query for each token.
+
+If an user inputs "seach" and cooccurrence search returns
+"search engine" and "web search realtime" because "seach" is
+in two input columns and corresponding completed word
+columns have "search engine" and "web search realtime".
+
+How to use
+----------
+
+.. groonga-command
+.. load --table event_query --each 'suggest_preparer(_id, type, item, sequence, time, pair_query)'
+.. [
+.. {"sequence": "1", "time": 1312950803.86057, "item": "search engine", "type": "submit"},
+.. {"sequence": "1", "time": 1312950808.86057, "item": "web search realtime", "type": "submit"}
+.. ]
+
+Groonga provides :doc:`commands/suggest` command to use
+completion. `--type suggest` option requests suggestion
+
+For example, here is an command to get completion results by
+"search":
+
+.. groonga-command
+.. include:: ../example/suggestion-1.log
+.. suggest --table item_query --column kana --types suggest --threshold 1 --query search
+
+How it learns
+-------------
+
+Cooccurrence search uses learned data. They are based on
+query logs, access logs and so on. To create learned data,
+groonga needs user input sequence with time stamp and user
+submit input with time stamp.
+
+For example, an user wants to search by "engine". The user
+inputs the query with the following sequence:
+
+  1. 2011-08-10T13:33:23+09:00: search engine (submit)
+  1. 2011-08-10T13:33:28+09:00: web search realtime (submit)
+
+Groonga can be learned from the submissions by the
+following command::
+
+  load --table event_query --each 'suggest_preparer(_id, type, item, sequence, time, pair_query)'
+  [
+  {"sequence": "1", "time": 1312950803.86057, "item": "search engine", "type": "submit"},
+  {"sequence": "1", "time": 1312950808.86057, "item": "web search realtime", "type": "submit"}
+  ]




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