The 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.
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
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>
--receive-host-name <127.0.0.1>
--droonga-engine-host-name <127.0.0.1>
--droonga-engine-port <24224>
--default-dataset <Droonga>
--tag <droonga>
--enable-logging
--cache-size <100>
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
See also the basic tutorial.
The Droonga HTTP Server includes following APIs:
GET /tables/<table name>
This emits a simple search request.
The source
is filled by the table name in the path.
Available query parameters are:
attributes
output.attributes
.
The value is a comma-separated list, like: attributes=_key,name,age
.query
condition.*.query
.
The vlaue is a query string.match_to
condition.*.matchTo
.
The vlaue is an comma-separated list, like: match_to=_key,name
.match_escalation_threshold
condition.*.matchEscalationThreshold
.
The vlaue is an integer.script
condition
in the script syntax.
If you specity both query
and script
, then they work with an and
logical condition.adjusters
adjusters
.sort_by
sortBy
.
The value is a column name string.limit
output.limit
.
The value is an integer.offset
output.offset
.
The value is an integer.GET /d/<command name>
(TBD)