[Groonga-commit] droonga/droonga.org at 3ef1fbc [gh-pages] tutorial basic ja: update

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Feb 9 23:15:16 JST 2014


Kouhei Sutou	2014-02-09 23:15:16 +0900 (Sun, 09 Feb 2014)

  New Revision: 3ef1fbcc8f1b93f25d41932cdeab5937588c72ee
  https://github.com/droonga/droonga.org/commit/3ef1fbcc8f1b93f25d41932cdeab5937588c72ee

  Message:
    tutorial basic ja: update

  Modified files:
    _po/ja/tutorial/basic/index.po
    ja/tutorial/basic/index.md

  Modified: _po/ja/tutorial/basic/index.po (+643 -3)
===================================================================
--- _po/ja/tutorial/basic/index.po    2014-02-09 23:11:12 +0900 (2fbcc54)
+++ _po/ja/tutorial/basic/index.po    2014-02-09 23:15:16 +0900 (236ce1c)
@@ -3,7 +3,7 @@ msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2011-11-20 22:17+0900\n"
-"PO-Revision-Date: 2014-02-07 19:31+0900\n"
+"PO-Revision-Date: 2014-02-09 23:13+0900\n"
 "Last-Translator: YUKI Hiroshi <piro.outsider.reflex �� gmail.com>\n"
 "Language-Team: Japanese\n"
 "Language: ja\n"
@@ -14,12 +14,12 @@ msgstr ""
 
 msgid ""
 "---\n"
-"title: Droonga tutorial\\: basic usage\n"
+"title: \"Droonga tutorial: basic usage\"\n"
 "layout: en\n"
 "---"
 msgstr ""
 "---\n"
-"title: Droonga チュートリアル\\: 基本的な使い方\n"
+"title: \"Droonga チュートリアル: 基本的な使い方\"\n"
 "layout: ja\n"
 "---"
 
@@ -69,6 +69,9 @@ msgstr ""
 msgid "### Components of the Droonga"
 msgstr "### Droonga を構成するコンポーネント"
 
+msgid "#### Droonga Engine"
+msgstr ""
+
 msgid ""
 "The component \"Droonga Engine\" is the main part to process data with a distrib"
 "uted architecture. It is triggered by requests and processes various data."
@@ -85,6 +88,9 @@ msgstr ""
 "[fluent-plugin-droonga][] は検索エンジンとして、オープンソースのカラムストア機能付き全文検索エンジン [Groonga][] を使"
 "用しています。"
 
+msgid "#### Protocol Adapter"
+msgstr ""
+
 msgid ""
 "The component \"Protocol Adapter\" provides ability for clients to communicate w"
 "ith a Droonga engine, using various protocols."
@@ -110,6 +116,19 @@ msgid "This tutorial describes steps to build a system like following:"
 msgstr "チュートリアルでは、以下の様な構成のシステムを構築します。"
 
 msgid ""
+"    +-------------+              +------------------+             +-----------"
+"-----+\n"
+"    | Web Browser |  <-------->  | Protocol Adapter |  <------->  | Droonga En"
+"gine |\n"
+"    +-------------+   HTTP /     +------------------+   Fluent    +-----------"
+"-----+\n"
+"                      Socket.IO   w/express-droonga     protocol   w/fluent-pl"
+"ugin\n"
+"                                                                           -dr"
+"oonga"
+msgstr ""
+
+msgid ""
 "                                 \\--------------------------------------------"
 "------/\n"
 "                                       This tutorial describes about this part"
@@ -165,6 +184,12 @@ msgstr "## セットアップに必要なパッケージをインストールす
 msgid "Install packages required to setup a Droonga engine."
 msgstr "Droonga をセットアップするために必要になるパッケージをインストールします。"
 
+msgid ""
+"    # apt-get update\n"
+"    # apt-get -y upgrade\n"
+"    # apt-get install -y ruby ruby-dev build-essential nodejs npm"
+msgstr ""
+
 msgid "## Build a Droonga engine"
 msgstr "## Droonga Engine を構築する"
 
@@ -180,6 +205,9 @@ msgstr ""
 msgid "### Install a fluent-plugin-droonga"
 msgstr "### fluent-plugin-droonga をインストールする"
 
+msgid "    # gem install fluent-plugin-droonga"
+msgstr ""
+
 msgid ""
 "Required packages are prepared by the command above. Let's continue to the con"
 "figuration step."
@@ -192,10 +220,87 @@ msgid "Create a directory for a Droonga engine:"
 msgstr "まず Droonga Engine 用のディレクトリを作成します。"
 
 msgid ""
+"    # mkdir engine\n"
+"    # cd engine"
+msgstr ""
+
+msgid ""
 "Next, put configuration files `fluentd.conf` and `catalog.json` like following"
 ", into the directory:"
 msgstr "以下の内容で `fluentd.conf` と `catalog.json` を作成します。"
 
+msgid "fluentd.conf:"
+msgstr ""
+
+msgid ""
+"    <source>\n"
+"      type forward\n"
+"      port 24224\n"
+"    </source>\n"
+"    <match starbucks.message>\n"
+"      name localhost:24224/starbucks\n"
+"      type droonga\n"
+"    </match>\n"
+"    <match output.message>\n"
+"      type stdout\n"
+"    </match>"
+msgstr ""
+
+msgid "catalog.json:"
+msgstr ""
+
+msgid ""
+"    {\n"
+"      \"effective_date\": \"2013-09-01T00:00:00Z\",\n"
+"      \"zones\": [\"localhost:24224/starbucks\"],\n"
+"      \"farms\": {\n"
+"        \"localhost:24224/starbucks\": {\n"
+"          \"device\": \".\",\n"
+"          \"capacity\": 10\n"
+"        }\n"
+"      },\n"
+"      \"datasets\": {\n"
+"        \"Starbucks\": {\n"
+"          \"workers\": 4,\n"
+"          \"plugins\": [\"groonga\", \"crud\", \"search\"],\n"
+"          \"number_of_replicas\": 2,\n"
+"          \"number_of_partitions\": 3,\n"
+"          \"partition_key\": \"_key\",\n"
+"          \"date_range\": \"infinity\",\n"
+"          \"ring\": {\n"
+"            \"localhost:24224:0\": {\n"
+"              \"weight\": 50,\n"
+"              \"partitions\": {\n"
+"                \"2013-09-01\": [\n"
+"                  \"localhost:24224/starbucks.000\",\n"
+"                  \"localhost:24224/starbucks.001\"\n"
+"                ]\n"
+"              }\n"
+"            },\n"
+"            \"localhost:24224:1\": {\n"
+"              \"weight\": 50,\n"
+"              \"partitions\": {\n"
+"                \"2013-09-01\": [\n"
+"                  \"localhost:24224/starbucks.010\",\n"
+"                  \"localhost:24224/starbucks.011\"\n"
+"                ]\n"
+"              }\n"
+"            },\n"
+"            \"localhost:24224:2\": {\n"
+"              \"weight\": 50,\n"
+"              \"partitions\": {\n"
+"                \"2013-09-01\": [\n"
+"                  \"localhost:24224/starbucks.020\",\n"
+"                  \"localhost:24224/starbucks.021\"\n"
+"                ]\n"
+"              }\n"
+"            }\n"
+"          }\n"
+"        }\n"
+"      }\n"
+"    }"
+msgstr ""
+
 msgid ""
 "This `catalog.json` defines a dataset `Starbucks` with two replicas and two pa"
 "rtitions.\n"
@@ -219,6 +324,55 @@ msgid ""
 "rted like:"
 msgstr "以下のようにして fluentd-plugin-droonga を起動します。"
 
+msgid ""
+"    # fluentd --config fluentd.conf --log fluentd.log --daemon fluentd.pid\n"
+"    # tail -F fluentd.log\n"
+"      </match>\n"
+"      <match output.message>\n"
+"        type stdout\n"
+"      </match>\n"
+"    </ROOT>\n"
+"    2014-02-09 14:37:08 +0900 [info]: adding source type=\"forward\"\n"
+"    2014-02-09 14:37:08 +0900 [info]: adding match pattern=\"starbucks.message\""
+" type=\"droonga\"\n"
+"    2014-02-09 14:37:08 +0900 [info]: adding match pattern=\"output.message\" ty"
+"pe=\"stdout\"\n"
+"    2014-02-09 14:37:08 +0900 [info]: catalog loaded path=\"/tmp/engine/catalog"
+".json\" mtime=2014-02-09 14:29:22 +0900\n"
+"    2014-02-09 14:37:08 +0900 [info]: listening fluent socket on 0.0.0.0:24224"
+msgstr ""
+
+msgid "### Stop an instance of fluent-plugin-droonga"
+msgstr "### fluent-plugin-droonga を終了する"
+
+msgid "First, you need to know how to stop fluent-plugin-droonga."
+msgstr "最初にfluent-plugin-droongaを終了する方法を知っておきましょう。"
+
+msgid "Send SIGTERM to fluentd:"
+msgstr "fluentdにSIGTERMを送ります。"
+
+msgid "    # kill $(cat fluentd.pid)"
+msgstr ""
+
+msgid "You will see the following message at `tail -F fluentd.log` terminal:"
+msgstr "`tail -F fluentd.log` を実行しているターミナルに次のメッセージがでているはずです。"
+
+msgid ""
+"    # tail -F fluentd.log\n"
+"    ...\n"
+"    2014-02-09 14:39:27 +0900 [info]: shutting down fluentd\n"
+"    2014-02-09 14:39:30 +0900 [info]: process finished code=0"
+msgstr ""
+
+msgid "This is the way to stop fluent-plugin-droonga."
+msgstr "これがfluent-plugin-droongaを終了する方法です。"
+
+msgid "Start fluent-plugin-droonga again:"
+msgstr "再度fluent-plugin-droongaを起動します。"
+
+msgid "    # fluentd --config fluentd.conf --log fluentd.log --daemon fluentd.pid"
+msgstr ""
+
 msgid "### Create a database"
 msgstr "### データベースを作成する"
 
@@ -230,12 +384,167 @@ msgstr ""
 "Dronga Engine が起動したので、データを投入しましょう。\n"
 "スキーマを定義した `ddl.jsons` と、店舗のデータ `stores.jsons` を用意します。"
 
+msgid "ddl.jsons:"
+msgstr ""
+
+msgid ""
+"    {\"id\":\"ddl:0\",\"dataset\":\"Starbucks\",\"type\":\"table_create\",\"replyTo\":\"local"
+"host:24224/output\",\"body\":{\"name\":\"Store\",\"flags\":\"TABLE_HASH_KEY\",\"key_type\":"
+"\"ShortText\"}}\n"
+"    {\"id\":\"ddl:1\",\"dataset\":\"Starbucks\",\"type\":\"column_create\",\"replyTo\":\"loca"
+"lhost:24224/output\",\"body\":{\"table\":\"Store\",\"name\":\"location\",\"flags\":\"COLUMN_"
+"SCALAR\",\"type\":\"WGS84GeoPoint\"}}\n"
+"    {\"id\":\"ddl:2\",\"dataset\":\"Starbucks\",\"type\":\"table_create\",\"replyTo\":\"local"
+"host:24224/output\",\"body\":{\"name\":\"Location\",\"flags\":\"TABLE_PAT_KEY\",\"key_type"
+"\":\"WGS84GeoPoint\"}}\n"
+"    {\"id\":\"ddl:3\",\"dataset\":\"Starbucks\",\"type\":\"column_create\",\"replyTo\":\"loca"
+"lhost:24224/output\",\"body\":{\"table\":\"Location\",\"name\":\"store\",\"flags\":\"COLUMN_"
+"INDEX\",\"type\":\"Store\",\"source\":\"location\"}}\n"
+"    {\"id\":\"ddl:4\",\"dataset\":\"Starbucks\",\"type\":\"table_create\",\"replyTo\":\"local"
+"host:24224/output\",\"body\":{\"name\":\"Term\",\"flags\":\"TABLE_PAT_KEY\",\"key_type\":\"S"
+"hortText\",\"default_tokenizer\":\"TokenBigram\",\"normalizer\":\"NormalizerAuto\"}}\n"
+"    {\"id\":\"ddl:5\",\"dataset\":\"Starbucks\",\"type\":\"column_create\",\"replyTo\":\"loca"
+"lhost:24224/output\",\"body\":{\"table\":\"Term\",\"name\":\"stores__key\",\"flags\":\"COLUM"
+"N_INDEX|WITH_POSITION\",\"type\":\"Store\",\"source\":\"_key\"}}"
+msgstr ""
+
+msgid "stores.jsons:"
+msgstr ""
+
+msgid ""
+"    {\"id\":\"stores:0\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\","
+"\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"1st Avenue & 75th St. - New York N"
+"Y  (W)\",\"values\":{\"location\":\"40.770262,-73.954798\"}}}\n"
+"    {\"id\":\"stores:1\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\","
+"\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"76th & Second - New York NY  (W)\","
+"\"values\":{\"location\":\"40.771056,-73.956757\"}}}\n"
+"    {\"id\":\"stores:2\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\","
+"\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"2nd Ave. & 9th Street - New York N"
+"Y\",\"values\":{\"location\":\"40.729445,-73.987471\"}}}\n"
+"    {\"id\":\"stores:3\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\","
+"\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"15th & Third - New York NY  (W)\",\""
+"values\":{\"location\":\"40.733946,-73.9867\"}}}\n"
+"    {\"id\":\"stores:4\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\","
+"\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"41st and Broadway - New York NY  ("
+"W)\",\"values\":{\"location\":\"40.755111,-73.986225\"}}}\n"
+"    {\"id\":\"stores:5\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\","
+"\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"84th & Third Ave - New York NY  (W"
+")\",\"values\":{\"location\":\"40.777485,-73.954979\"}}}\n"
+"    {\"id\":\"stores:6\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\","
+"\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"150 E. 42nd Street - New York NY  "
+"(W)\",\"values\":{\"location\":\"40.750784,-73.975582\"}}}\n"
+"    {\"id\":\"stores:7\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\","
+"\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"West 43rd and Broadway - New York "
+"NY  (W)\",\"values\":{\"location\":\"40.756197,-73.985624\"}}}\n"
+"    {\"id\":\"stores:8\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\","
+"\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"Macy's 35th Street Balcony - New Y"
+"ork NY\",\"values\":{\"location\":\"40.750703,-73.989787\"}}}\n"
+"    {\"id\":\"stores:9\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\","
+"\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"Macy's 6th Floor - Herald Square -"
+" New York NY  (W)\",\"values\":{\"location\":\"40.750703,-73.989787\"}}}\n"
+"    {\"id\":\"stores:10\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"Herald Square- Macy's - New York "
+"NY\",\"values\":{\"location\":\"40.750703,-73.989787\"}}}\n"
+"    {\"id\":\"stores:11\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"Macy's 5th Floor - Herald Square "
+"- New York NY  (W)\",\"values\":{\"location\":\"40.750703,-73.989787\"}}}\n"
+"    {\"id\":\"stores:12\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"80th & York - New York NY  (W)\",\""
+"values\":{\"location\":\"40.772204,-73.949862\"}}}\n"
+"    {\"id\":\"stores:13\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"Columbus @ 67th - New York NY  (W"
+")\",\"values\":{\"location\":\"40.774009,-73.981472\"}}}\n"
+"    {\"id\":\"stores:14\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"45th & Broadway - New York NY  (W"
+")\",\"values\":{\"location\":\"40.75766,-73.985719\"}}}\n"
+"    {\"id\":\"stores:15\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"Marriott Marquis - Lobby - New Yo"
+"rk NY\",\"values\":{\"location\":\"40.759123,-73.984927\"}}}\n"
+"    {\"id\":\"stores:16\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"Second @ 81st - New York NY  (W)\""
+",\"values\":{\"location\":\"40.77466,-73.954447\"}}}\n"
+"    {\"id\":\"stores:17\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"52nd & Seventh - New York NY  (W)"
+"\",\"values\":{\"location\":\"40.761829,-73.981141\"}}}\n"
+"    {\"id\":\"stores:18\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"1585 Broadway (47th) - New York N"
+"Y  (W)\",\"values\":{\"location\":\"40.759806,-73.985066\"}}}\n"
+"    {\"id\":\"stores:19\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"85th & First - New York NY  (W)\","
+"\"values\":{\"location\":\"40.776101,-73.949971\"}}}\n"
+"    {\"id\":\"stores:20\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"92nd & 3rd - New York NY  (W)\",\"v"
+"alues\":{\"location\":\"40.782606,-73.951235\"}}}\n"
+"    {\"id\":\"stores:21\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"165 Broadway - 1 Liberty - New Yo"
+"rk NY  (W)\",\"values\":{\"location\":\"40.709727,-74.011395\"}}}\n"
+"    {\"id\":\"stores:22\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"1656 Broadway - New York NY  (W)\""
+",\"values\":{\"location\":\"40.762434,-73.983364\"}}}\n"
+"    {\"id\":\"stores:23\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"54th & Broadway - New York NY  (W"
+")\",\"values\":{\"location\":\"40.764275,-73.982361\"}}}\n"
+"    {\"id\":\"stores:24\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"Limited Brands-NYC - New York NY\""
+",\"values\":{\"location\":\"40.765219,-73.982025\"}}}\n"
+"    {\"id\":\"stores:25\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"19th & 8th - New York NY  (W)\",\"v"
+"alues\":{\"location\":\"40.743218,-74.000605\"}}}\n"
+"    {\"id\":\"stores:26\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"60th & Broadway-II - New York NY "
+" (W)\",\"values\":{\"location\":\"40.769196,-73.982576\"}}}\n"
+"    {\"id\":\"stores:27\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"63rd & Broadway - New York NY  (W"
+")\",\"values\":{\"location\":\"40.771376,-73.982709\"}}}\n"
+"    {\"id\":\"stores:28\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"195 Broadway - New York NY  (W)\","
+"\"values\":{\"location\":\"40.710703,-74.009485\"}}}\n"
+"    {\"id\":\"stores:29\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"2 Broadway - New York NY  (W)\",\"v"
+"alues\":{\"location\":\"40.704538,-74.01324\"}}}\n"
+"    {\"id\":\"stores:30\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"2 Columbus Ave. - New York NY  (W"
+")\",\"values\":{\"location\":\"40.769262,-73.984764\"}}}\n"
+"    {\"id\":\"stores:31\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"NY Plaza - New York NY  (W)\",\"val"
+"ues\":{\"location\":\"40.702802,-74.012784\"}}}\n"
+"    {\"id\":\"stores:32\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"36th and Madison - New York NY  ("
+"W)\",\"values\":{\"location\":\"40.748917,-73.982683\"}}}\n"
+"    {\"id\":\"stores:33\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"125th St. btwn Adam Clayton & FDB"
+" - New York NY\",\"values\":{\"location\":\"40.808952,-73.948229\"}}}\n"
+"    {\"id\":\"stores:34\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"70th & Broadway - New York NY  (W"
+")\",\"values\":{\"location\":\"40.777463,-73.982237\"}}}\n"
+"    {\"id\":\"stores:35\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"2138 Broadway - New York NY  (W)\""
+",\"values\":{\"location\":\"40.781078,-73.981167\"}}}\n"
+"    {\"id\":\"stores:36\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"118th & Frederick Douglas Blvd. -"
+" New York NY  (W)\",\"values\":{\"location\":\"40.806176,-73.954109\"}}}\n"
+"    {\"id\":\"stores:37\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"42nd & Second - New York NY  (W)\""
+",\"values\":{\"location\":\"40.750069,-73.973393\"}}}\n"
+"    {\"id\":\"stores:38\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"Broadway @ 81st - New York NY  (W"
+")\",\"values\":{\"location\":\"40.784972,-73.978987\"}}}\n"
+"    {\"id\":\"stores:39\",\"replyTo\":\"localhost:24224/output\",\"dataset\":\"Starbucks\""
+",\"type\":\"add\",\"body\":{\"table\":\"Store\",\"key\":\"Fashion Inst of Technology - New "
+"York NY\",\"values\":{\"location\":\"40.746948,-73.994557\"}}}"
+msgstr ""
+
 msgid ""
 "Open another terminal to keep the fluentd server working, and send those two j"
 "sons `ddl.jsons` and `stores.jsons` to the fluentd server:"
 msgstr "fluentd を起動した状態で別の端末を開き、以下のようにして `ddl.jsons` と `stores.jsons` を投入します:"
 
 msgid ""
+"    # fluent-cat starbucks.message < ddl.jsons\n"
+"    # fluent-cat starbucks.message < stores.jsons"
+msgstr ""
+
+msgid ""
 "Now a Droonga engine for searching Starbucks stores database is ready.\n"
 "Next, setup a protocol adapter for clients to accept search requests using pop"
 "ular protocols."
@@ -256,21 +565,81 @@ msgstr ""
 msgid "### Install a express-droonga"
 msgstr "### express-droonga をインストールする"
 
+msgid ""
+"    # cd ~\n"
+"    # mkdir protocol-adapter\n"
+"    # cd protocol-adapter"
+msgstr ""
+
 msgid "After that, put a file `package.json` like following, into the directory:"
 msgstr "以下のような `package.json` を用意します。"
 
+msgid "package.json:"
+msgstr ""
+
+msgid ""
+"    {\n"
+"      \"name\": \"protocol-adapter\",\n"
+"      \"description\": \"Droonga Protocol Adapter\",\n"
+"      \"version\": \"0.0.0\",\n"
+"      \"author\": \"Droonga Project\",\n"
+"      \"private\": true,\n"
+"      \"dependencies\": {\n"
+"        \"express\": \"*\",\n"
+"        \"express-droonga\": \"*\"\n"
+"      }\n"
+"    }"
+msgstr ""
+
 msgid "Install depending packages."
 msgstr "必要なパッケージをインストールします。"
 
+msgid "    $ npm install"
+msgstr ""
+
 msgid "### Create a protocol adapter"
 msgstr "### Protocol Adapter を作成する"
 
 msgid "Put a file `application.js` like following, into the directory:"
 msgstr "以下のような内容で `application.js` を作成します。"
 
+msgid "application.js:"
+msgstr ""
+
+msgid ""
+"    var express = require('express'),\n"
+"        droonga = require('express-droonga');"
+msgstr ""
+
+msgid ""
+"    var application = express();\n"
+"    var server = require('http').createServer(application);\n"
+"    server.listen(3000); // the port to communicate with clients"
+msgstr ""
+
+msgid ""
+"    application.droonga({\n"
+"      prefix: '/droonga',\n"
+"      tag: 'starbucks',\n"
+"      defaultDataset: 'Starbucks',\n"
+"      server: server, // this is required to initialize Socket.IO API!\n"
+"      plugins: [\n"
+"        droonga.API_REST,\n"
+"        droonga.API_SOCKET_IO,\n"
+"        droonga.API_GROONGA,\n"
+"        droonga.API_DROONGA\n"
+"      ]\n"
+"    });"
+msgstr ""
+
 msgid "Then, run the `application.js`."
 msgstr "`application.js` を実行します。"
 
+msgid ""
+"    # nodejs application.js\n"
+"       info  - socket.io started"
+msgstr ""
+
 msgid "### Synchronous search request via HTTP"
 msgstr "### HTTPでの同期的な検索のリクエスト"
 
@@ -290,6 +659,138 @@ msgstr ""
 "として受け取ることができます)"
 
 msgid ""
+"    # curl \"http://localhost:3000/droonga/tables/Store?attributes=_key&limit=-"
+"1\"\n"
+"    {\n"
+"      \"stores\": {\n"
+"        \"count\": 40,\n"
+"        \"records\": [\n"
+"          [\n"
+"            \"76th & Second - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"15th & Third - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"41st and Broadway - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"West 43rd and Broadway - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"Macy's 6th Floor - Herald Square - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"Herald Square- Macy's - New York NY\"\n"
+"          ],\n"
+"          [\n"
+"            \"Columbus @ 67th - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"45th & Broadway - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"1585 Broadway (47th) - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"85th & First - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"92nd & 3rd - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"1656 Broadway - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"19th & 8th - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"60th & Broadway-II - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"195 Broadway - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"2 Broadway - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"NY Plaza - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"36th and Madison - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"125th St. btwn Adam Clayton & FDB - New York NY\"\n"
+"          ],\n"
+"          [\n"
+"            \"2138 Broadway - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"118th & Frederick Douglas Blvd. - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"42nd & Second - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"1st Avenue & 75th St. - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"2nd Ave. & 9th Street - New York NY\"\n"
+"          ],\n"
+"          [\n"
+"            \"84th & Third Ave - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"150 E. 42nd Street - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"Macy's 35th Street Balcony - New York NY\"\n"
+"          ],\n"
+"          [\n"
+"            \"Macy's 5th Floor - Herald Square - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"80th & York - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"Marriott Marquis - Lobby - New York NY\"\n"
+"          ],\n"
+"          [\n"
+"            \"Second @ 81st - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"52nd & Seventh - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"165 Broadway - 1 Liberty - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"54th & Broadway - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"Limited Brands-NYC - New York NY\"\n"
+"          ],\n"
+"          [\n"
+"            \"63rd & Broadway - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"2 Columbus Ave. - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"70th & Broadway - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"Broadway @ 81st - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"Fashion Inst of Technology - New York NY\"\n"
+"          ]\n"
+"        ]\n"
+"      }\n"
+"    }"
+msgstr ""
+
+msgid ""
 "Because the `count` says `40`, you know there are all 40 records in the table."
 " Search result records are returned as an array `records`."
 msgstr "`count` の値からデータが全部で 36 件あることがわかります。`records` に配列として検索結果が入っています。"
@@ -302,6 +803,24 @@ msgstr ""
 "もう少し複雑なクエリを試してみましょう。例えば、店名に「Columbus」を含む店舗を検索します。`query` パラメータにクエリ `Columbus` "
 "を、`match_to` パラメータに検索対象として `_key` を指定し、以下のようなリクエストを発行します。"
 
+msgid ""
+"    # curl \"http://localhost:3000/droonga/tables/Store?query=Columbus&match_to"
+"=_key&attributes=_key&limit=-1\"\n"
+"    {\n"
+"      \"stores\": {\n"
+"        \"count\": 2,\n"
+"        \"records\": [\n"
+"          [\n"
+"            \"Columbus @ 67th - New York NY  (W)\"\n"
+"          ],\n"
+"          [\n"
+"            \"2 Columbus Ave. - New York NY  (W)\"\n"
+"          ]\n"
+"        ]\n"
+"      }\n"
+"    }"
+msgstr ""
+
 msgid "As the result two stores are found by the search condition."
 msgstr "以上 2 件が検索結果として該当することがわかりました。"
 
@@ -332,6 +851,41 @@ msgstr ""
 "Protocol Adapter から `index.html` を配信し、Webブラウザに渡すことにしましょう。\n"
 "`protocol-adapter` ディレクトリの下に以下の内容の `index.html` を配置します。"
 
+msgid "index.html:"
+msgstr ""
+
+msgid ""
+"    <html>\n"
+"      <head>\n"
+"        <script src=\"/socket.io/socket.io.js\"></script>\n"
+"        <script>\n"
+"          var socket = io.connect();\n"
+"          socket.on('search.result', function (data) {\n"
+"            document.body.textContent += JSON.stringify(data);\n"
+"          });\n"
+"          socket.emit('search', { queries: {\n"
+"            stores: {\n"
+"              source: 'Store',\n"
+"              output: {\n"
+"                 elements: [\n"
+"                   'startTime',\n"
+"                   'elapsedTime',\n"
+"                   'count',\n"
+"                   'attributes',\n"
+"                   'records'\n"
+"                 ],\n"
+"                 attributes: ['_key'],\n"
+"                 limit: -1\n"
+"              }\n"
+"            }\n"
+"          }});\n"
+"        </script>\n"
+"      </head>\n"
+"      <body>\n"
+"      </body>\n"
+"    </html>"
+msgstr ""
+
 msgid ""
 "This client sends a search query by `socket.emit()`. After the request is proc"
 "essed and the result is returned, the callback given as `socket.on('search.res"
@@ -367,6 +921,14 @@ msgstr ""
 "き換えます。"
 
 msgid ""
+"    //============== INSERTED ==============\n"
+"    application.get('/', function(req, res) {\n"
+"      res.sendfile(__dirname + '/index.html');\n"
+"    });\n"
+"    //============= /INSERTED =============="
+msgstr ""
+
+msgid ""
 "Then, type the IP address of the server for experiments into the address bar o"
 "f your Web browser. For example, if the IP address is `192.0.2.1`, then the lo"
 "cation is `http://192.0.2.1:3000/` and you can see the contents of the `index."
@@ -379,6 +941,30 @@ msgstr ""
 "Webブラウザから `http://192.0.2.1:3000` を開いてみてください。以下のように検索結果が表示されれば成功です。"
 
 msgid ""
+"    {\"stores\":{\"count\":40,\"records\":[[\"76th & Second - New York NY (W)\"],[\"15t"
+"h & Third - New York NY (W)\"],[\"41st and Broadway - New York NY (W)\"],[\"West 4"
+"3rd and Broadway - New York NY (W)\"],[\"Macy's 6th Floor - Herald Square - New "
+"York NY (W)\"],[\"Herald Square- Macy's - New York NY\"],[\"Columbus @ 67th - New "
+"York NY (W)\"],[\"45th & Broadway - New York NY (W)\"],[\"1585 Broadway (47th) - N"
+"ew York NY (W)\"],[\"85th & First - New York NY (W)\"],[\"92nd & 3rd - New York NY"
+" (W)\"],[\"1656 Broadway - New York NY (W)\"],[\"19th & 8th - New York NY (W)\"],[\""
+"60th & Broadway-II - New York NY (W)\"],[\"195 Broadway - New York NY (W)\"],[\"2 "
+"Broadway - New York NY (W)\"],[\"NY Plaza - New York NY (W)\"],[\"36th and Madison"
+" - New York NY (W)\"],[\"125th St. btwn Adam Clayton & FDB - New York NY\"],[\"213"
+"8 Broadway - New York NY (W)\"],[\"118th & Frederick Douglas Blvd. - New York NY"
+" (W)\"],[\"42nd & Second - New York NY (W)\"],[\"1st Avenue & 75th St. - New York "
+"NY (W)\"],[\"2nd Ave. & 9th Street - New York NY\"],[\"84th & Third Ave - New York"
+" NY (W)\"],[\"150 E. 42nd Street - New York NY (W)\"],[\"Macy's 35th Street Balcon"
+"y - New York NY\"],[\"Macy's 5th Floor - Herald Square - New York NY (W)\"],[\"80t"
+"h & York - New York NY (W)\"],[\"Marriott Marquis - Lobby - New York NY\"],[\"Seco"
+"nd @ 81st - New York NY (W)\"],[\"52nd & Seventh - New York NY (W)\"],[\"165 Broad"
+"way - 1 Liberty - New York NY (W)\"],[\"54th & Broadway - New York NY (W)\"],[\"Li"
+"mited Brands-NYC - New York NY\"],[\"63rd & Broadway - New York NY (W)\"],[\"2 Col"
+"umbus Ave. - New York NY (W)\"],[\"70th & Broadway - New York NY (W)\"],[\"Broadwa"
+"y @ 81st - New York NY (W)\"],[\"Fashion Inst of Technology - New York NY\"]]}}"
+msgstr ""
+
+msgid ""
 "Your Web browser sends a request to the protocol adapter via Socket.IO, the pr"
 "otocol adapter sends it to the Droonga engine via fluent protocol, the engine "
 "returns the search result to the protocol adapter, and the protocol adapter se"
@@ -397,11 +983,52 @@ msgstr ""
 "` の呼び出しを書き換え、以下の様な `index.html` を用意します。"
 
 msgid ""
+"    <html>\n"
+"      <head>\n"
+"        <script src=\"/socket.io/socket.io.js\"></script>\n"
+"        <script>\n"
+"          var socket = io.connect();\n"
+"          socket.on('search.result', function (data) {\n"
+"            document.body.textContent += JSON.stringify(data);\n"
+"          });\n"
+"          socket.emit('search', { queries: {\n"
+"            stores: {\n"
+"              source: 'Store',\n"
+"              condition: {\n"
+"                query: 'Columbus',\n"
+"                matchTo: '_key'\n"
+"              },\n"
+"              output: {\n"
+"                 elements: [\n"
+"                   'startTime',\n"
+"                   'elapsedTime',\n"
+"                   'count',\n"
+"                   'attributes',\n"
+"                   'records'\n"
+"                 ],\n"
+"                 attributes: ['_key'],\n"
+"                 limit: -1\n"
+"              }\n"
+"            }\n"
+"          }});\n"
+"        </script>\n"
+"      </head>\n"
+"      <body>\n"
+"      </body>\n"
+"    </html>"
+msgstr ""
+
+msgid ""
 "Reload the current page `http://192.0.2.1:3000` in your Web browser, then you'"
 "ll see a search result like following:"
 msgstr "ブラウザで再度 `http://192.0.2.1:3000` を開くと、以下のような検索結果が表示されます。"
 
 msgid ""
+"    {\"stores\":{\"count\":2,\"records\":[[\"Columbus @ 67th - New York NY (W)\"],[\"2 "
+"Columbus Ave. - New York NY (W)\"]]}}"
+msgstr ""
+
+msgid ""
 "OK, you've successfully created a client application which can send search req"
 "uests and receive responses asynchronously via Socket.IO."
 msgstr "このように、Socket.IO を利用して、リクエストとレスポンスを非同期に送受信する検索クライアントを作成することができました。"
@@ -419,3 +1046,16 @@ msgstr ""
 "[Ubuntu Linux][Ubuntu] 上に [Droonga][] を構成するパッケージである [fluent-plugin-droonga][] "
 "と [express-droonga][] をセットアップしました。\n"
 "これらのパッケージを利用することで、Protocol Adapter と Droonga Engine からなるシステムを構築し、実際に検索を行いました。"
+
+msgid ""
+"  [Ubuntu]: http://www.ubuntu.com/\n"
+"  [Droonga]: https://droonga.org/\n"
+"  [fluent-plugin-droonga]: https://github.com/droonga/fluent-plugin-droonga\n"
+"  [express-droonga]: https://github.com/droonga/express-droonga\n"
+"  [Groonga]: http://groonga.org/\n"
+"  [Ruby]: http://www.ruby-lang.org/\n"
+"  [nvm]: https://github.com/creationix/nvm\n"
+"  [Socket.IO]: http://socket.io/\n"
+"  [Fluentd]: http://fluentd.org/\n"
+"  [Node.js]: http://nodejs.org/"
+msgstr ""

  Modified: ja/tutorial/basic/index.md (+44 -24)
===================================================================
--- ja/tutorial/basic/index.md    2014-02-09 23:11:12 +0900 (74bc44f)
+++ ja/tutorial/basic/index.md    2014-02-09 23:15:16 +0900 (5d0c71b)
@@ -130,14 +130,14 @@ catalog.json:
       },
       "datasets": {
         "Starbucks": {
-          "workers": 0,
-          "plugins": ["crud", "search", "groonga"],
+          "workers": 4,
+          "plugins": ["groonga", "crud", "search"],
           "number_of_replicas": 2,
-          "number_of_partitions": 2,
+          "number_of_partitions": 3,
           "partition_key": "_key",
           "date_range": "infinity",
           "ring": {
-            "localhost:23041": {
+            "localhost:24224:0": {
               "weight": 50,
               "partitions": {
                 "2013-09-01": [
@@ -146,12 +146,21 @@ catalog.json:
                 ]
               }
             },
-            "localhost:23042": {
+            "localhost:24224:1": {
               "weight": 50,
               "partitions": {
                 "2013-09-01": [
-                  "localhost:24224/starbucks.002",
-                  "localhost:24224/starbucks.003"
+                  "localhost:24224/starbucks.010",
+                  "localhost:24224/starbucks.011"
+                ]
+              }
+            },
+            "localhost:24224:2": {
+              "weight": 50,
+              "partitions": {
+                "2013-09-01": [
+                  "localhost:24224/starbucks.020",
+                  "localhost:24224/starbucks.021"
                 ]
               }
             }
@@ -169,28 +178,39 @@ catalog.json:
 
 以下のようにして fluentd-plugin-droonga を起動します。
 
-    # fluentd --config fluentd.conf
-    2013-11-12 14:14:20 +0900 [info]: starting fluentd-0.10.40
-    2013-11-12 14:14:20 +0900 [info]: reading config file path="fluentd.conf"
-    2013-11-12 14:14:20 +0900 [info]: gem 'fluent-plugin-droonga' version '0.0.1'
-    2013-11-12 14:14:20 +0900 [info]: gem 'fluentd' version '0.10.40'
-    2013-11-12 14:14:20 +0900 [info]: using configuration file: <ROOT>
-      <source>
-        type forward
-        port 24224
-      </source>
-      <match starbucks.message>
-        name localhost:24224/starbucks
-        type droonga
+    # fluentd --config fluentd.conf --log fluentd.log --daemon fluentd.pid
+    # tail -F fluentd.log
       </match>
       <match output.message>
         type stdout
       </match>
     </ROOT>
-    2013-11-12 14:14:20 +0900 [info]: adding source type="forward"
-    2013-11-12 14:14:20 +0900 [info]: adding match pattern="starbucks.message" type="droonga"
-    2013-11-12 14:14:20 +0900 [info]: adding match pattern="output.message" type="stdout"
-    2013-11-12 14:14:20 +0900 [info]: listening fluent socket on 0.0.0.0:24224
+    2014-02-09 14:37:08 +0900 [info]: adding source type="forward"
+    2014-02-09 14:37:08 +0900 [info]: adding match pattern="starbucks.message" type="droonga"
+    2014-02-09 14:37:08 +0900 [info]: adding match pattern="output.message" type="stdout"
+    2014-02-09 14:37:08 +0900 [info]: catalog loaded path="/tmp/engine/catalog.json" mtime=2014-02-09 14:29:22 +0900
+    2014-02-09 14:37:08 +0900 [info]: listening fluent socket on 0.0.0.0:24224
+
+### fluent-plugin-droonga を終了する
+
+最初にfluent-plugin-droongaを終了する方法を知っておきましょう。
+
+fluentdにSIGTERMを送ります。
+
+    # kill $(cat fluentd.pid)
+
+`tail -F fluentd.log` を実行しているターミナルに次のメッセージがでているはずです。
+
+    # tail -F fluentd.log
+    ...
+    2014-02-09 14:39:27 +0900 [info]: shutting down fluentd
+    2014-02-09 14:39:30 +0900 [info]: process finished code=0
+
+これがfluent-plugin-droongaを終了する方法です。
+
+再度fluent-plugin-droongaを起動します。
+
+    # fluentd --config fluentd.conf --log fluentd.log --daemon fluentd.pid
 
 ### データベースを作成する
 
-------------- next part --------------
HTML����������������������������...
Download 



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