[Groonga-commit] droonga/fluent-plugin-droonga at 1d09a70 [master] Use more suitable name for the method to trnsform search query

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Dec 5 12:55:37 JST 2013


YUKI Hiroshi	2013-12-05 12:55:37 +0900 (Thu, 05 Dec 2013)

  New Revision: 1d09a7043d98e36392c3da025fa6c216ea04bd9d
  https://github.com/droonga/fluent-plugin-droonga/commit/1d09a7043d98e36392c3da025fa6c216ea04bd9d

  Message:
    Use more suitable name for the method to trnsform search query

  Modified files:
    lib/droonga/plugin/distributor/distributed_search_plan.rb

  Modified: lib/droonga/plugin/distributor/distributed_search_plan.rb (+5 -3)
===================================================================
--- lib/droonga/plugin/distributor/distributed_search_plan.rb    2013-12-05 12:46:57 +0900 (dd73041)
+++ lib/droonga/plugin/distributor/distributed_search_plan.rb    2013-12-05 12:55:37 +0900 (ed879da)
@@ -36,8 +36,7 @@ module Droonga
       ensure_unifiable!
 
       @queries.each do |input_name, query|
-        # Skip reducing phase for a result with no output.
-        @messages << build_reducer(input_name, query) if query["output"]
+        transform_query(input_name, query)
       end
 
       gatherer = {
@@ -80,6 +79,8 @@ module Droonga
 
     def build_reducer(input_name, query)
       output = query["output"]
+      # Skip reducing phase for a result with no output.
+      return unless output
 
       @input_names << input_name
       output_name = input_name + "_reduced"
@@ -156,7 +157,7 @@ module Droonga
         @output_mappers[output_name]["elements"]["records"] = mapper
       end
 
-      {
+      reducer = {
         "type" => "reduce",
         "body" => {
           input_name => {
@@ -166,6 +167,7 @@ module Droonga
         "inputs" => [input_name], # XXX should be placed in the "body"?
         "outputs" => [output_name], # XXX should be placed in the "body"?
       }
+      @messages << reducer
     end
 
     def calculate_offset_and_limit!(query)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index