Yoji Shidara
null+****@clear*****
Wed Feb 5 16:51:07 JST 2014
Yoji Shidara 2014-02-05 16:51:07 +0900 (Wed, 05 Feb 2014) New Revision: 4f72101ec2666605ae67d7ec90b5ce65488e4b78 https://github.com/droonga/droonga.org/commit/4f72101ec2666605ae67d7ec90b5ce65488e4b78 Message: Split into subsections Modified files: tutorial/plugin-development/input-output/index.md Modified: tutorial/plugin-development/input-output/index.md (+8 -1) =================================================================== --- tutorial/plugin-development/input-output/index.md 2014-02-05 16:46:36 +0900 (728928e) +++ tutorial/plugin-development/input-output/index.md 2014-02-05 16:51:07 +0900 (daed90f) @@ -156,7 +156,7 @@ If you have [jq][] installed, you can use `jq` instead of `tr`: jq -c . search-columbus.json | fluent-cat starbucks.message -### Do something in the plugin +### Do something in the plugin: take logs The plugin we have created do nothing so far. Let's get the plugin to do some interesting. @@ -186,6 +186,8 @@ And restart fluentd, then send the request same as the previous. You will see so This shows the message is received by our `ExampleInputAdapterPlugin` and then passed to Droonga. Here we can modify the message before the actual data processing. +### Modify messages with InputAdapter + Suppose that we want to restrict the number of records returned in the response, say `1`. What we need to do is set `limit` to be `1` for every request. Update plugin like below: lib/droonga/plugin/input_adapter/example.rb: @@ -213,6 +215,11 @@ And restart fluentd. After restart, the response always includes only one record Note that `count` is still `2` because `limit` does not affect `count`. See [search][] for details of `search` command. +### Defining original command + +TODO: write steps to create a new command "starbucks" and accept simple query + + ## OutputAdapter In this section, we are going to create an `OutputAdapter`. -------------- next part -------------- HTML����������������������������...Download