Kouhei Sutou
null+****@clear*****
Tue Feb 18 10:18:50 JST 2014
Kouhei Sutou 2014-02-18 10:18:50 +0900 (Tue, 18 Feb 2014) New Revision: a0e3e5904d341ba78223d6d27a69a51b73a78666 https://github.com/droonga/droonga.org/commit/a0e3e5904d341ba78223d6d27a69a51b73a78666 Message: Update .po and translated files Added files: _po/ja/reference/catalog/version2.po _po/ja/tutorial/watch.po ja/reference/catalog/version2.md ja/tutorial/watch.md Modified files: _po/ja/reference/catalog/index.po _po/ja/tutorial/basic/index.po Modified: _po/ja/reference/catalog/index.po (+45 -5) =================================================================== --- _po/ja/reference/catalog/index.po 2014-02-18 10:14:43 +0900 (7128da5) +++ _po/ja/reference/catalog/index.po 2014-02-18 10:18:50 +0900 (95fe44e) @@ -334,33 +334,73 @@ msgstr "" msgid "### `zones`" msgstr "" -msgid "It is an array of farms." +msgid "" +"`Zones` is an array to express proximities between farms.\n" +"Farms are grouped by a zone, and zones can be grouped by another zone recursiv" +"ely.\n" +"Zones make a single tree structure, expressed by nested arrays.\n" +"Farms in a same branch are regarded as relatively closer than other farms." +msgstr "" + +msgid "e.g." +msgstr "" + +msgid "When the value of `zones` is as follows," +msgstr "" + +msgid "" +"```\n" +"[[\"A\", [\"B\", \"C\"]], \"D\"]\n" +"```" +msgstr "" + +msgid "it expresses the following tree." msgstr "" msgid "" +" /\\\n" +" /\\ D\n" +" A /\\\n" +" B C" +msgstr "" + +msgid "" +"This tree means the farm \"B\" and \"C\" are closer than \"A\" or \"D\" to each other." +"\n" "You should make elements in a `zones` close to each other, like in the\n" "same host, in the same switch, in the same network." msgstr "" +msgid "This is an optional parameter." +msgstr "" + msgid "" "~~~json\n" "{\n" " \"zones\": [\n" -" \"localhost:23003/farm0\",\n" -" \"localhost:23003/farm1\",\n" -" \"localhost:23004/farm0\"\n" +" [\"localhost:23003/farm0\",\n" +" \"localhost:23003/farm1\"],\n" +" [\"localhost:23004/farm0\",\n" +" \"localhost:23004/farm1\"]\n" " ]\n" "}\n" "~~~" msgstr "" +msgid "" +"*TODO: Discuss about the call of this parameter. This seems completely equals " +"to the list of keys of `farms`.*" +msgstr "" + msgid "### `farms`" msgstr "" msgid "It is an array of Droonga Engine instances." msgstr "" -msgid "TODO: IMPROVE ME." +msgid "" +"*TODO: Improve me. For example, we have to describe relations of nested farms," +" ex. `children`.*" msgstr "" msgid "" Added: _po/ja/reference/catalog/version2.po (+410 -0) 100644 =================================================================== --- /dev/null +++ _po/ja/reference/catalog/version2.po 2014-02-18 10:18:50 +0900 (d903c43) @@ -0,0 +1,410 @@ +msgid "" +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: 2013-12-25 18:27+0900\n" +"Last-Translator: Kouhei Sutou <kou �� clear-code.com>\n" +"Language-Team: Japanese\n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +msgid "" +"---\n" +"title: Catalog\n" +"layout: en\n" +"---" +msgstr "" +"---\n" +"title: カタログ\n" +"layout: ja\n" +"---" + +msgid "" +"* TOC\n" +"{:toc}" +msgstr "" + +msgid "## Abstract {#abstract}" +msgstr "## 概要 {#abstract}" + +msgid "## Usage {#usage}" +msgstr "## 使い方 {#usage}" + +msgid "" +"This [`version`](#parameter-version) of `catalog` will be available from Droon" +"ga 1.0.0." +msgstr "" + +msgid "## Syntax {#syntax}" +msgstr "" + +msgid "" +" {\n" +" \"version\": <Version number>,\n" +" \"effective_date\": \"<Effective date>\",\n" +" \"datasets\": {\n" +" \"<Name of the dataset 1>\": {\n" +" \"n_workers\": <Number of workers>,\n" +" \"plugins\": [\n" +" \"Name of the plugin 1\",\n" +" ...\n" +" ],\n" +" \"schema\": {\n" +" \"<Name of the table 1>\": {\n" +" \"flags\" : \"<Flags for the table>\",\n" +" \"key_type\" : \"<Type of the primary key>\",\n" +" \"default_tokenizer\" : \"<Default tokenizer>\",\n" +" \"normalizer\" : \"<Normalizer>\",\n" +" \"columns\" : {\n" +" \"<Name of the column 1>\": {\n" +" \"flags\" : \"<Flags for the column>\",\n" +" \"type\" : \"<Type of the value>\",\n" +" \"source\" : \"<Name of a column to be indexed>\"\n" +" },\n" +" \"<Name of the column 2>\": { ... },\n" +" ...\n" +" }\n" +" },\n" +" \"<Name of the table 2>\": { ... },\n" +" ...\n" +" },\n" +" \"fact\": \"<Name of the fact table>\",\n" +" \"replicas\": [\n" +" {\n" +" \"dimension\": \"<Name of the dimension column>\",\n" +" \"slicer\": \"<Name of the slicer function>\",\n" +" \"slices\": [\n" +" {\n" +" \"label\": \"<Label of the slice>\",\n" +" \"partition\": {\n" +" \"address\": \"<Address string of the partition>\"\n" +" }\n" +" },\n" +" ...\n" +" }\n" +" },\n" +" ...\n" +" ]\n" +" },\n" +" \"<Name of the dataset 2>\": { ... },\n" +" ...\n" +" }\n" +" }" +msgstr "" + +msgid "## Details {#details}" +msgstr "" + +msgid "### Catalog definition {#catalog}" +msgstr "" + +msgid "" +"Value\n" +": An object with the following key/value pairs." +msgstr "" + +msgid "#### `version` {#parameter-version}" +msgstr "" + +msgid "" +"Abstract\n" +": Version number of the catalog file." +msgstr "" + +msgid "" +"Value\n" +": `2`. (Specification written in this page is valid only when this value is `2" +"`)" +msgstr "" + +msgid "" +"Default value\n" +": None. This is a required parameter." +msgstr "" + +msgid "" +"Inheritable\n" +": False." +msgstr "" + +msgid "#### `effective_date` {#paramter-effective_date}" +msgstr "" + +msgid "" +"Abstract\n" +": The time when this catalog becomes effective." +msgstr "" + +msgid "" +"Value\n" +": A local time string formatted in the [W3C-DTF](http://www.w3.org/TR/NOTE-dat" +"etime \"Date and Time Formats\"), with the time zone." +msgstr "" + +msgid "#### `datasets` {#parameter-datasets}" +msgstr "" + +msgid "" +"Abstract\n" +": Definition of datasets." +msgstr "" + +msgid "" +"Value\n" +": An object keyed by the name of the dataset with value the [`dataset` definit" +"ion](#dataset)." +msgstr "" + +msgid "#### `n_workers` {#parameter-n_workers}" +msgstr "" + +msgid "" +"Abstract\n" +": The number of worker processes spawned for each database instance." +msgstr "" + +msgid "" +"Value\n" +": An integer value." +msgstr "" + +msgid "" +"Default value\n" +": 0 (No worker. All operations are done in the master process)" +msgstr "" + +msgid "" +"Inheritable\n" +": True. Overridable in `dataset` and `partition` definition." +msgstr "" + +msgid "### Dataset definition {#dataset}" +msgstr "" + +msgid "#### `plugins` {#parameter-plugins}" +msgstr "" + +msgid "" +"Abstract\n" +": plugin names." +msgstr "" + +msgid "" +"Value\n" +": An array of strings." +msgstr "" + +msgid "#### `schema` {#parameter-schema}" +msgstr "" + +msgid "" +"Abstract\n" +": Definition of tables and their columns." +msgstr "" + +msgid "" +"Value\n" +": An object keyed by the name of the table with value the [`table` definition]" +"(#table)." +msgstr "" + +msgid "#### `fact` {#parameter-fact}" +msgstr "" + +msgid "" +"Abstract\n" +": Name of the fact table. When a `dataset` is stored as more than one `slice`," +" one [fact table](http://en.wikipedia.org/wiki/Fact_table) must be selected fr" +"om tables defined in [`schema`](#parameter-schema) parameter." +msgstr "" + +msgid "" +"Value\n" +": A string." +msgstr "" + +msgid "" +"Default value\n" +": None." +msgstr "" + +msgid "#### `replicas` {#parameter-replicas}" +msgstr "" + +msgid "" +"Abstract\n" +": Definition of replicas which store the contents of the dataset." +msgstr "" + +msgid "" +"Value\n" +": An array of [`partition` definitions](#partition)." +msgstr "" + +msgid "### Table definition {#table}" +msgstr "" + +msgid "" +"Value\n" +": An object with the following keys." +msgstr "" + +msgid "" +"* \"flags\"\n" +"* \"key_type\"\n" +"* \"default_tokenizer\"\n" +"* \"normalizer\"\n" +"* \"columns\"" +msgstr "" + +msgid "" +"All parameters except `columns`, `name` and `value_type` are compatible with [" +"the parameters of the `table_create` command of the Groonga](http://groonga.or" +"g/docs/reference/commands/table_create.html#parameters). See the linked docume" +"nt for more details." +msgstr "" + +msgid "#### `columns` {#parameter-columns}" +msgstr "" + +msgid "Abstract" +msgstr "" + +msgid ": Column definition for the table." +msgstr "" + +msgid "" +"Value\n" +": An object keyed by the name of the column with value the [`column` definitio" +"n](#column)." +msgstr "" + +msgid "### Column definition {#column}" +msgstr "" + +msgid "Value" +msgstr "" + +msgid ": An object with the following keys." +msgstr "" + +msgid "" +"* \"flags\"\n" +"* \"type\"\n" +"* \"source\"" +msgstr "" + +msgid "" +"All parameters except `table` and `name` are compatible to [the parameters of " +"the `column_create` command of the Groonga](http://groonga.org/docs/reference/" +"commands/column_create.html#parameters). See the linked document for more deta" +"ils." +msgstr "" + +msgid "### Partition definition {#partition}" +msgstr "" + +msgid "#### `address` {#parameter-address}" +msgstr "" + +msgid "" +"Abstract\n" +": (TBD)" +msgstr "" + +msgid "" +"Value\n" +": (TBD)" +msgstr "" + +msgid "#### `dimension` {#parameter-dimension}" +msgstr "" + +msgid "" +"Abstract\n" +": When a `dataset` is stored as more than one `slice`, either '_key\" or a scal" +"ar type column must be selected from [`columns`](#parameter-columns) parameter" +" of the fact table. When the selected column is a foreign key, the refered tab" +"le is called [dimension table](http://en.wikipedia.org/wiki/Dimension_table)." +msgstr "" + +msgid "" +"Default value\n" +": \"_key\"" +msgstr "" + +msgid "#### `slicer` {#parameter-slicer}" +msgstr "" + +msgid "" +"Abstract\n" +": Function to slice the value of dimension column." +msgstr "" + +msgid "" +"Value\n" +": Name of slicer function." +msgstr "" + +msgid "" +"Default value\n" +": \"hash\"" +msgstr "" + +msgid "#### `slices` {#parameter-slices}" +msgstr "" + +msgid "" +"Abstract\n" +": Definition of slices which store the contents of the data." +msgstr "" + +msgid "" +"Value\n" +": An array of [`slice` definitions](#slice)." +msgstr "" + +msgid "### Slice definition {#slice}" +msgstr "" + +msgid "A slice has one of `weight`, `label` or `boundary` parameters.." +msgstr "" + +msgid "#### `weight` {#parameter-weight}" +msgstr "" + +msgid "" +"Abstract\n" +": Avaible when the slicer is ratio-scaled." +msgstr "" + +msgid "" +"Default value\n" +": 1." +msgstr "" + +msgid "#### `label` {#parameter-label}" +msgstr "" + +msgid "" +"Abstract\n" +": Avaible when the slicer is nominal-scaled." +msgstr "" + +msgid "#### `boundary` {#parameter-boundary}" +msgstr "" + +msgid "" +"Abstract\n" +": Avaible when the slicer is ordinal-scaled." +msgstr "" + +msgid "#### `partition` {#parameter-partition}" +msgstr "" + +msgid ": An object which is a [`partition` definition](#partition)" +msgstr "" Modified: _po/ja/tutorial/basic/index.po (+3 -0) =================================================================== --- _po/ja/tutorial/basic/index.po 2014-02-18 10:14:43 +0900 (3426849) +++ _po/ja/tutorial/basic/index.po 2014-02-18 10:18:50 +0900 (eaac8e8) @@ -609,6 +609,9 @@ msgid "" "~~~" msgstr "" +msgid "Send `stores.jsons` as follows:" +msgstr "" + msgid "~~~" msgstr "" Added: _po/ja/tutorial/watch.po (+285 -0) 100644 =================================================================== --- /dev/null +++ _po/ja/tutorial/watch.po 2014-02-18 10:18:50 +0900 (047152e) @@ -0,0 +1,285 @@ +msgid "" +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: 2013-12-25 18:27+0900\n" +"Last-Translator: Kouhei Sutou <kou �� clear-code.com>\n" +"Language-Team: Japanese\n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +msgid "" +"---\n" +"title: Droonga tutorial\n" +"layout: en\n" +"---" +msgstr "" +"---\n" +"title: Droonga チュートリアル\n" +"layout: ja\n" +"---" + +msgid "" +"* TOC\n" +"{:toc}" +msgstr "" + +msgid "## Real-time search" +msgstr "" + +msgid "Droonga supports streaming-style real-time search." +msgstr "" + +msgid "### Update configurations of the Droonga engine" +msgstr "" + +msgid "Update your fluentd.conf and catalog.jsons, like:" +msgstr "" + +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 droonga.message>\n" +" + name localhost:24224/droonga\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\": [\n" +" + \"localhost:24224/droonga\",\n" +" \"localhost:24224/starbucks\"\n" +" ],\n" +" \"farms\": {\n" +" + \"localhost:24224/droonga\": {\n" +" + \"device\": \".\",\n" +" + \"capacity\": 10\n" +" + },\n" +" \"localhost:24224/starbucks\": {\n" +" \"device\": \".\",\n" +" \"capacity\": 10\n" +" }\n" +" },\n" +" \"datasets\": {\n" +" + \"Watch\": {\n" +" + \"workers\": 2,\n" +" + \"plugins\": [\"search\", \"groonga\", \"add\", \"watch\"],\n" +" + \"number_of_replicas\": 1,\n" +" + \"number_of_partitions\": 1,\n" +" + \"partition_key\": \"_key\",\n" +" + \"date_range\": \"infinity\",\n" +" + \"ring\": {\n" +" + \"localhost:23041\": {\n" +" + \"weight\": 50,\n" +" + \"partitions\": {\n" +" + \"2013-09-01\": [\n" +" + \"localhost:24224/droonga.watch\"\n" +" + ]\n" +" + }\n" +" + }\n" +" + }\n" +" + },\n" +" \"Starbucks\": {\n" +" \"workers\": 0,\n" +" \"plugins\": [\"search\", \"groonga\", \"add\"],\n" +" \"number_of_replicas\": 2,\n" +" \"number_of_partitions\": 2,\n" +" \"partition_key\": \"_key\",\n" +" \"date_range\": \"infinity\",\n" +" \"ring\": {\n" +" \"localhost:23041\": {\n" +" \"weight\": 50,\n" +" \"partitions\": {\n" +" \"2013-09-01\": [\n" +" \"localhost:24224/starbucks.000\",\n" +" \"localhost:24224/starbucks.001\"\n" +" ]\n" +" }\n" +" },\n" +" \"localhost:23042\": {\n" +" \"weight\": 50,\n" +" \"partitions\": {\n" +" \"2013-09-01\": [\n" +" \"localhost:24224/starbucks.002\",\n" +" \"localhost:24224/starbucks.003\"\n" +" ]\n" +" }\n" +" }\n" +" }\n" +" }\n" +" },\n" +" \"options\": {\n" +" \"plugins\": []\n" +" }\n" +" }" +msgstr "" + +msgid "### Add a streaming API to the protocol adapter" +msgstr "" + +msgid "Add a streaming API to the protocol adapter, like;" +msgstr "" + +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 "" +" //============== INSERTED ==============\n" +" var streaming = {\n" +" 'streaming': new droonga.command.HTTPStreaming({\n" +" dataset: 'Watch',\n" +" path: '/watch',\n" +" method: 'GET',\n" +" subscription: 'watch.subscribe',\n" +" unsubscription: 'watch.unsubscribe',\n" +" notification: 'watch.notification',\n" +" createSubscription: function(request) {\n" +" return {\n" +" condition: request.query.query\n" +" };\n" +" }\n" +" })\n" +" };\n" +" //============= /INSERTED ==============" +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" +" //============== INSERTED ==============\n" +" ,streaming\n" +" //============= /INSERTED ==============\n" +" ]\n" +" });" +msgstr "" + +msgid "" +" application.get('/', function(req, res) {\n" +" res.sendfile(__dirname + '/index.html');\n" +" });" +msgstr "" + +msgid "### Prepare feeds" +msgstr "" + +msgid "Prepare \"feed\"s like:" +msgstr "" + +msgid "feeds.jsons:" +msgstr "" + +msgid "" +" {\"id\":\"feed:0\",\"dataset\":\"Watch\",\"type\":\"watch.feed\",\"body\":{\"targets\":{\"k" +"ey\":\"old place 0\"}}}\n" +" {\"id\":\"feed:1\",\"dataset\":\"Watch\",\"type\":\"watch.feed\",\"body\":{\"targets\":{\"k" +"ey\":\"new place 0\"}}}\n" +" {\"id\":\"feed:2\",\"dataset\":\"Watch\",\"type\":\"watch.feed\",\"body\":{\"targets\":{\"k" +"ey\":\"old place 1\"}}}\n" +" {\"id\":\"feed:3\",\"dataset\":\"Watch\",\"type\":\"watch.feed\",\"body\":{\"targets\":{\"k" +"ey\":\"new place 1\"}}}\n" +" {\"id\":\"feed:4\",\"dataset\":\"Watch\",\"type\":\"watch.feed\",\"body\":{\"targets\":{\"k" +"ey\":\"old place 2\"}}}\n" +" {\"id\":\"feed:5\",\"dataset\":\"Watch\",\"type\":\"watch.feed\",\"body\":{\"targets\":{\"k" +"ey\":\"new place 2\"}}}" +msgstr "" + +msgid "### Try it!" +msgstr "" + +msgid "At first, restart servers in each console." +msgstr "" + +msgid "The engine:" +msgstr "" + +msgid " # fluentd --config fluentd.conf" +msgstr "" + +msgid "The protocol adapter:" +msgstr "" + +msgid " # nodejs application.js" +msgstr "" + +msgid "Next, connect to the streaming API via curl:" +msgstr "" + +msgid " # curl \"http://localhost:3000/droonga/watch?query=new\"" +msgstr "" + +msgid "Then the client starts to receive streamed results." +msgstr "" + +msgid "Next, open a new console and send \"feed\"s to the engine like:" +msgstr "" + +msgid " # fluent-cat droonga.message < feeds.jsons" +msgstr "" + +msgid "" +"Then the client receives three results \"new place 0\", \"new place 1\", and \"new " +"place 2\" like:" +msgstr "" + +msgid "" +" {\"targets\":{\"key\":\"new place 0\"}}\n" +" {\"targets\":{\"key\":\"new place 1\"}}\n" +" {\"targets\":{\"key\":\"new place 2\"}}" +msgstr "" + +msgid "" +"They are search results for the query \"new\", given as a query parameter of the" +" streaming API." +msgstr "" + +msgid "Results can be appear in different order, like:" +msgstr "" + +msgid "" +" {\"targets\":{\"key\":\"new place 1\"}}\n" +" {\"targets\":{\"key\":\"new place 0\"}}\n" +" {\"targets\":{\"key\":\"new place 2\"}}" +msgstr "" + +msgid "because \"feed\"s are processed in multiple workers asynchronously." +msgstr "" Added: ja/reference/catalog/version2.md (+365 -0) 100644 =================================================================== --- /dev/null +++ ja/reference/catalog/version2.md 2014-02-18 10:18:50 +0900 (0123c56) @@ -0,0 +1,365 @@ +--- +title: カタログ +layout: ja +--- + +{% comment %} +############################################## + THIS FILE IS AUTOMATICALLY GENERATED FROM + "_po/ja/reference/catalog/version2.po" + DO NOT EDIT THIS FILE MANUALLY! +############################################## +{% endcomment %} + + +* TOC +{:toc} + +## 概要 {#abstract} + +## 使い方 {#usage} + +This [`version`](#parameter-version) of `catalog` will be available from Droonga 1.0.0. + +## Syntax {#syntax} + + { + "version": <Version number>, + "effective_date": "<Effective date>", + "datasets": { + "<Name of the dataset 1>": { + "n_workers": <Number of workers>, + "plugins": [ + "Name of the plugin 1", + ... + ], + "schema": { + "<Name of the table 1>": { + "flags" : "<Flags for the table>", + "key_type" : "<Type of the primary key>", + "default_tokenizer" : "<Default tokenizer>", + "normalizer" : "<Normalizer>", + "columns" : { + "<Name of the column 1>": { + "flags" : "<Flags for the column>", + "type" : "<Type of the value>", + "source" : "<Name of a column to be indexed>" + }, + "<Name of the column 2>": { ... }, + ... + } + }, + "<Name of the table 2>": { ... }, + ... + }, + "fact": "<Name of the fact table>", + "replicas": [ + { + "dimension": "<Name of the dimension column>", + "slicer": "<Name of the slicer function>", + "slices": [ + { + "label": "<Label of the slice>", + "partition": { + "address": "<Address string of the partition>" + } + }, + ... + } + }, + ... + ] + }, + "<Name of the dataset 2>": { ... }, + ... + } + } + +## Details {#details} + +### Catalog definition {#catalog} + +Value +: An object with the following key/value pairs. + +#### `version` {#parameter-version} + +Abstract +: Version number of the catalog file. + +Value +: `2`. (Specification written in this page is valid only when this value is `2`) + +Default value +: None. This is a required parameter. + +Inheritable +: False. + +#### `effective_date` {#paramter-effective_date} + +Abstract +: The time when this catalog becomes effective. + +Value +: A local time string formatted in the [W3C-DTF](http://www.w3.org/TR/NOTE-datetime "Date and Time Formats"), with the time zone. + +Default value +: None. This is a required parameter. + +Inheritable +: False. + +#### `datasets` {#parameter-datasets} + +Abstract +: Definition of datasets. + +Value +: An object keyed by the name of the dataset with value the [`dataset` definition](#dataset). + +Default value +: None. This is a required parameter. + +Inheritable +: False. + +#### `n_workers` {#parameter-n_workers} + +Abstract +: The number of worker processes spawned for each database instance. + +Value +: An integer value. + +Default value +: 0 (No worker. All operations are done in the master process) + +Inheritable +: True. Overridable in `dataset` and `partition` definition. + +### Dataset definition {#dataset} + +Value +: An object with the following key/value pairs. + +#### `plugins` {#parameter-plugins} + +Abstract +: plugin names. + +Value +: An array of strings. + +Default value +: None. This is a required parameter. + +Inheritable +: True. Overridable in `dataset` and `partition` definition. + +#### `schema` {#parameter-schema} + +Abstract +: Definition of tables and their columns. + +Value +: An object keyed by the name of the table with value the [`table` definition](#table). + +Default value +: None. This is a required parameter. + +Inheritable +: True. Overridable in `dataset` and `partition` definition. + +#### `fact` {#parameter-fact} + +Abstract +: Name of the fact table. When a `dataset` is stored as more than one `slice`, one [fact table](http://en.wikipedia.org/wiki/Fact_table) must be selected from tables defined in [`schema`](#parameter-schema) parameter. + +Value +: A string. + +Default value +: None. + +Inheritable +: True. Overridable in `dataset` and `partition` definition. + +#### `replicas` {#parameter-replicas} + +Abstract +: Definition of replicas which store the contents of the dataset. + +Value +: An array of [`partition` definitions](#partition). + +Default value +: None. This is a required parameter. + +Inheritable +: False. + +### Table definition {#table} + +Value +: An object with the following keys. + +* "flags" +* "key_type" +* "default_tokenizer" +* "normalizer" +* "columns" + +All parameters except `columns`, `name` and `value_type` are compatible with [the parameters of the `table_create` command of the Groonga](http://groonga.org/docs/reference/commands/table_create.html#parameters). See the linked document for more details. + +#### `columns` {#parameter-columns} + +Abstract + +: Column definition for the table. + +Value +: An object keyed by the name of the column with value the [`column` definition](#column). + +Default value +: None. + +Inheritable +: False. + +### Column definition {#column} + +Value + +: An object with the following keys. + +* "flags" +* "type" +* "source" + +All parameters except `table` and `name` are compatible to [the parameters of the `column_create` command of the Groonga](http://groonga.org/docs/reference/commands/column_create.html#parameters). See the linked document for more details. + +### Partition definition {#partition} + +Value +: An object with the following key/value pairs. + +#### `address` {#parameter-address} + +Abstract +: (TBD) + +Value +: (TBD) + +Default value +: None. + +Inheritable +: False. + +#### `dimension` {#parameter-dimension} + +Abstract +: When a `dataset` is stored as more than one `slice`, either '_key" or a scalar type column must be selected from [`columns`](#parameter-columns) parameter of the fact table. When the selected column is a foreign key, the refered table is called [dimension table](http://en.wikipedia.org/wiki/Dimension_table). + +Value +: A string. + +Default value +: "_key" + +Inheritable +: True. Overridable in `dataset` and `partition` definition. + +#### `slicer` {#parameter-slicer} + +Abstract +: Function to slice the value of dimension column. + +Value +: Name of slicer function. + +Default value +: "hash" + +Inheritable +: True. Overridable in `dataset` and `partition` definition. + +#### `slices` {#parameter-slices} + +Abstract +: Definition of slices which store the contents of the data. + +Value +: An array of [`slice` definitions](#slice). + +Default value +: None. + +Inheritable +: False. + +### Slice definition {#slice} + +A slice has one of `weight`, `label` or `boundary` parameters.. + +Value +: An object with the following key/value pairs. + +#### `weight` {#parameter-weight} + +Abstract +: Avaible when the slicer is ratio-scaled. + +Value +: (TBD) + +Default value +: 1. + +Inheritable +: False. + +#### `label` {#parameter-label} + +Abstract +: Avaible when the slicer is nominal-scaled. + +Value +: (TBD) + +Default value +: None. + +Inheritable +: False. + +#### `boundary` {#parameter-boundary} + +Abstract +: Avaible when the slicer is ordinal-scaled. + +Value +: (TBD) + +Default value +: None. + +Inheritable +: False. + +#### `partition` {#parameter-partition} + +Abstract +: (TBD) + +Value + +: An object which is a [`partition` definition](#partition) + +Default value +: None. + +Inheritable +: False. Added: ja/tutorial/watch.md (+217 -0) 100644 =================================================================== --- /dev/null +++ ja/tutorial/watch.md 2014-02-18 10:18:50 +0900 (8402846) @@ -0,0 +1,217 @@ +--- +title: Droonga チュートリアル +layout: ja +--- + +{% comment %} +############################################## + THIS FILE IS AUTOMATICALLY GENERATED FROM + "_po/ja/tutorial/watch.po" + DO NOT EDIT THIS FILE MANUALLY! +############################################## +{% endcomment %} + + +* TOC +{:toc} + +## Real-time search + +Droonga supports streaming-style real-time search. + +### Update configurations of the Droonga engine + +Update your fluentd.conf and catalog.jsons, like: + +fluentd.conf: + + <source> + type forward + port 24224 + </source> + <match starbucks.message> + name localhost:24224/starbucks + type droonga + </match> + + <match droonga.message> + + name localhost:24224/droonga + + type droonga + + </match> + <match output.message> + type stdout + </match> + +catalog.json: + + { + "effective_date": "2013-09-01T00:00:00Z", + "zones": [ + + "localhost:24224/droonga", + "localhost:24224/starbucks" + ], + "farms": { + + "localhost:24224/droonga": { + + "device": ".", + + "capacity": 10 + + }, + "localhost:24224/starbucks": { + "device": ".", + "capacity": 10 + } + }, + "datasets": { + + "Watch": { + + "workers": 2, + + "plugins": ["search", "groonga", "add", "watch"], + + "number_of_replicas": 1, + + "number_of_partitions": 1, + + "partition_key": "_key", + + "date_range": "infinity", + + "ring": { + + "localhost:23041": { + + "weight": 50, + + "partitions": { + + "2013-09-01": [ + + "localhost:24224/droonga.watch" + + ] + + } + + } + + } + + }, + "Starbucks": { + "workers": 0, + "plugins": ["search", "groonga", "add"], + "number_of_replicas": 2, + "number_of_partitions": 2, + "partition_key": "_key", + "date_range": "infinity", + "ring": { + "localhost:23041": { + "weight": 50, + "partitions": { + "2013-09-01": [ + "localhost:24224/starbucks.000", + "localhost:24224/starbucks.001" + ] + } + }, + "localhost:23042": { + "weight": 50, + "partitions": { + "2013-09-01": [ + "localhost:24224/starbucks.002", + "localhost:24224/starbucks.003" + ] + } + } + } + } + }, + "options": { + "plugins": [] + } + } + +### Add a streaming API to the protocol adapter + + +Add a streaming API to the protocol adapter, like; + +application.js: + + var express = require('express'), + droonga = require('express-droonga'); + + var application = express(); + var server = require('http').createServer(application); + server.listen(3000); // the port to communicate with clients + + //============== INSERTED ============== + var streaming = { + 'streaming': new droonga.command.HTTPStreaming({ + dataset: 'Watch', + path: '/watch', + method: 'GET', + subscription: 'watch.subscribe', + unsubscription: 'watch.unsubscribe', + notification: 'watch.notification', + createSubscription: function(request) { + return { + condition: request.query.query + }; + } + }) + }; + //============= /INSERTED ============== + + application.droonga({ + prefix: '/droonga', + tag: 'starbucks', + defaultDataset: 'Starbucks', + server: server, // this is required to initialize Socket.IO API! + plugins: [ + droonga.API_REST, + droonga.API_SOCKET_IO, + droonga.API_GROONGA, + droonga.API_DROONGA + //============== INSERTED ============== + ,streaming + //============= /INSERTED ============== + ] + }); + + application.get('/', function(req, res) { + res.sendfile(__dirname + '/index.html'); + }); + +### Prepare feeds + +Prepare "feed"s like: + +feeds.jsons: + + {"id":"feed:0","dataset":"Watch","type":"watch.feed","body":{"targets":{"key":"old place 0"}}} + {"id":"feed:1","dataset":"Watch","type":"watch.feed","body":{"targets":{"key":"new place 0"}}} + {"id":"feed:2","dataset":"Watch","type":"watch.feed","body":{"targets":{"key":"old place 1"}}} + {"id":"feed:3","dataset":"Watch","type":"watch.feed","body":{"targets":{"key":"new place 1"}}} + {"id":"feed:4","dataset":"Watch","type":"watch.feed","body":{"targets":{"key":"old place 2"}}} + {"id":"feed:5","dataset":"Watch","type":"watch.feed","body":{"targets":{"key":"new place 2"}}} + +### Try it! + +At first, restart servers in each console. + +The engine: + + # fluentd --config fluentd.conf + +The protocol adapter: + + # nodejs application.js + +Next, connect to the streaming API via curl: + + # curl "http://localhost:3000/droonga/watch?query=new" + +Then the client starts to receive streamed results. + +Next, open a new console and send "feed"s to the engine like: + + # fluent-cat droonga.message < feeds.jsons + +Then the client receives three results "new place 0", "new place 1", and "new place 2" like: + + {"targets":{"key":"new place 0"}} + {"targets":{"key":"new place 1"}} + {"targets":{"key":"new place 2"}} + +They are search results for the query "new", given as a query parameter of the streaming API. + +Results can be appear in different order, like: + + {"targets":{"key":"new place 1"}} + {"targets":{"key":"new place 0"}} + {"targets":{"key":"new place 2"}} + +because "feed"s are processed in multiple workers asynchronously. + -------------- next part -------------- HTML����������������������������... 다운로드