Skip to content

Commit

Permalink
Reduce errors separately
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jan 29, 2014
1 parent 9f54fb0 commit 77bf48c
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions lib/droonga/plugin/distributor/distributed_search_planner.rb
Expand Up @@ -44,6 +44,21 @@ def build_messages
transform_query(input_name, query)
end

errors_reducer = {
"type" => "reduce",
"body" => {
"errors" => {
"errors_reduced" => {
"type" => "sum",
"limit" => -1,
},
},
},
"inputs" => ["errors"],
"outputs" => ["errors_reduced"],
}
@messages << errors_reducer

gatherer = {
"type" => "search_gather",
"body" => @output_mappers.merge({
Expand Down Expand Up @@ -105,15 +120,9 @@ def transform_query(input_name, query)
input_name => {
output_name => transformer.reducers,
},
"errors" => {
"errors_reduced" => {
"type" => "sum",
"limit" => -1,
},
},
},
"inputs" => [input_name, "errors"], # XXX should be placed in the "body"?
"outputs" => [output_name, "errors_reduced"], # XXX should be placed in the "body"?
"inputs" => [input_name], # XXX should be placed in the "body"?
"outputs" => [output_name], # XXX should be placed in the "body"?
}
@messages << reducer

Expand Down

0 comments on commit 77bf48c

Please sign in to comment.