YUKI Hiroshi
null+****@clear*****
Fri Mar 28 21:06:12 JST 2014
YUKI Hiroshi 2014-03-28 21:06:12 +0900 (Fri, 28 Mar 2014) New Revision: 935e65a84408933bcd2cbabe65ed52f9815ce27a https://github.com/droonga/droonga.org/commit/935e65a84408933bcd2cbabe65ed52f9815ce27a Message: Add a reference of droonga-http-server Added files: reference/http-server/index.md Modified files: reference/index.md Added: reference/http-server/index.md (+142 -0) 100644 =================================================================== --- /dev/null +++ reference/http-server/index.md 2014-03-28 21:06:12 +0900 (c88813b) @@ -0,0 +1,142 @@ +--- +title: Droonga HTTP Server +layout: en +--- + +* TOC +{:toc} + +## Abstract {#abstract} + +The [Droonga HTTP Server][droonga-http-server] is as an HTTP protocol adapter for the Droonga Engine. + +The Droonga Engine supports only the fluentd protocol, so you have to use `fluent-cat` or something, to communicate with the Drooga Engine. +This application provides ability to communicate with the Droonga Engine via HTTP. + +## Install {#install} + +It is released as the [droonga-http-server npm module][], a [Node.js][] module package. +You can install it via the `npm` command, like: + + # npm install -g droonga-http-server + +## Usage {#usage} + +### Command line options {#usage-command} + +It includes a command `droonga-http-server` to start an HTTP server. +You can start it with command line options, like: + + # droonga-http-server --port 3003 + +Available options and their default values are: + +`--port <13000>` +: The port number which the server receives HTTP requests at. + +`--receive-host-name <127.0.0.1>` +: The host name (or the IP address) of the computer itself which the server is running. + It is used by the Droonga Engine, to send response messages to the protocol adapter. + +`--droonga-engine-host-name <127.0.0.1>` +: The host name (or the IP address) of the computer which the Droonga Engine is running on. + +`--droonga-engine-port <24224>` +: The port number which the Droonga Engine receives messages at. + +`--default-dataset <Droonga>` +: The name of the default dataset. + It is used for requests triggered via REST APIs. + +`--tag <droonga>` +: The tag used for fluentd messages sent to the Droonga Engine. + +`--enable-logging` +: If you specify this option, log messages are printed to the standard output. + +`--cache-size <100>` +: The maximum size of the LRU response cache. + Droonga HTTP server caches all responses for GET requests on the RAM, unthil this size. + +You have to specify appropriate values for your Droonga Engine. For example, if the HTTP server is running on the host 192.168.10.90 and the Droonga engine is running on the host 192.168.10.100 with following configurations: + +fluentd.conf: + + <source> + type forward + port 24324 + </source> + <match books.message> + name localhost:24224/books + type droonga + </match> + <match output.message> + type stdout + </match> + +catalog.json: + + { + "version": 2, + "effectiveDate": "2013-09-01T00:00:00Z", + "datasets": { + "Books": { + ... + } + } + } + +Then, you'll start the HTTP server on the host 192.168.10.90, with options like: + + # droonga-http-server --receive-host-name 192.168.10.90 \ + --droonga-engine-host-name 192.168.10.100 \ + --droonga-engine-port 24324 \ + --default-dataset Books \ + --tag books + +## Built-in APIs + +### GET /tables/<table name>` + +This emits a [search request](../commands/search/). +Available query parameters are: + +`attributes` +: Corresponds to [`output.attributes`](../commands/search/#query-output). + The value is a comma-separated list, like: `attributes=_key,name,age`. + +`query` +: Corresponds to [`condition.*.query`](../commands/search/#query-condition-query-syntax-hash). + The vlaue is a query string. + +`match_to` +: Corresponds to [`condition.*.matchTo`](../commands/search/#query-condition-query-syntax-hash). + The vlaue is an comma-separated list, like: `match_to=_key,name`. + +`match_escalation_threshold` +: Corresponds to [`condition.*.matchEscalationThreshold`](../commands/search/#query-condition-query-syntax-hash). + The vlaue is an integer. + +`script` +: Corresponds to [`condition`](../commands/search/#query-condition-query-syntax-hash) in the script syntax. + If you specity both `query` and `script`, then they work with an `and` logical condition. + +`adjusters` +: Corresponds to `adjusters`. + +`sort_by` +: Corresponds to [`sortBy`](../commands/search/#query-sortBy). + The value is an integer. + +`limit` +: Corresponds to [`output.limit`](../commands/search/#query-output). + The value is an integer. + +`offset` +: Corresponds to [`output.offset`](../commands/search/#query-output). + The value is an integer. + + + [droonga-http-server]: https://github.com/droonga/droonga-http-server + [droonga-http-server npm module]: https://npmjs.org/package/droonga-http-server + [Node.js]: http://nodejs.org/ Modified: reference/index.md (+3 -0) =================================================================== --- reference/index.md 2014-03-28 19:45:06 +0900 (9af6892) +++ reference/index.md 2014-03-28 21:06:12 +0900 (f8db40c) @@ -12,5 +12,8 @@ layout: en [Commands](commands/) : Describes details of built-in commands available on the Droonga Engines. +[Droonga HTTP Server](http-server/) +: Describes usage of the [droonga-http-server](https://github.com/droonga/droonga-http-server). + [Plugin development](plugin/) : Describes details of public APIs to develop custom plugins for the Droonga Engine. -------------- next part -------------- HTML����������������������������...Download