[Groonga-commit] droonga/fluent-plugin-droonga at 6b60114 [master] Extract operation to set "unifiable" flag to a method

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Dec 5 10:24:58 JST 2013


YUKI Hiroshi	2013-12-05 10:24:58 +0900 (Thu, 05 Dec 2013)

  New Revision: 6b601143471abdaca975415899bb2296f711245f
  https://github.com/droonga/fluent-plugin-droonga/commit/6b601143471abdaca975415899bb2296f711245f

  Message:
    Extract operation to set "unifiable" flag to a method

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

  Modified: lib/droonga/plugin/distributor/search.rb (+10 -5)
===================================================================
--- lib/droonga/plugin/distributor/search.rb    2013-12-04 20:44:24 +0900 (d815775)
+++ lib/droonga/plugin/distributor/search.rb    2013-12-05 10:24:58 +0900 (113fdfa)
@@ -31,11 +31,7 @@ module Droonga
       request = envelope["body"]
       queries = request["queries"]
 
-      queries.each do |name, query|
-        if unifiable?(name, queries) && query["output"]
-          query["output"]["unifiable"] = true
-        end
-      end
+      ensure_unifiable!(queries)
 
       queries.each do |input_name, query|
         output = query["output"]
@@ -129,6 +125,7 @@ module Droonga
         }
         message << reducer
       end
+
       gatherer = {
         "type" => "gather",
         "body" => output_mapper,
@@ -151,6 +148,14 @@ module Droonga
     private
     UNLIMITED = -1
 
+    def ensure_unifiable!(queries)
+      queries.each do |name, query|
+        if unifiable?(name, queries) && query["output"]
+          query["output"]["unifiable"] = true
+        end
+      end
+    end
+
     def unifiable?(name, queries)
       query = queries[name]
       return true if query["groupBy"]
-------------- next part --------------
HTML����������������������������...
Download 



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