[Groonga-commit] droonga/fluent-plugin-droonga at 3be0a45 [master] Define unifiable? method

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Dec 5 14:37:16 JST 2013


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

  New Revision: 3be0a45e5fef8b49443ab56cea5a06aa72ba8881
  https://github.com/droonga/fluent-plugin-droonga/commit/3be0a45e5fef8b49443ab56cea5a06aa72ba8881

  Message:
    Define unifiable? method

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

  Modified: lib/droonga/plugin/distributor/distributed_search_plan.rb (+8 -6)
===================================================================
--- lib/droonga/plugin/distributor/distributed_search_plan.rb    2013-12-05 14:26:42 +0900 (fe83b39)
+++ lib/droonga/plugin/distributor/distributed_search_plan.rb    2013-12-05 14:37:16 +0900 (833c123)
@@ -190,13 +190,17 @@ module Droonga
         @records_limit = final_limit
       end
 
+      def unifiable?
+        @output["unifiable"]
+      end
+
       def build_count_mapper_and_reducer!
         return unless @output["elements"].include?("count")
 
         @reducers["count"] = {
           "type" => "sum",
         }
-        if @output["unifiable"]
+        if unifiable?
           if @query["sortBy"] && @query["sortBy"].is_a?(Hash)
             @query["sortBy"]["limit"] = -1
           end
@@ -225,14 +229,12 @@ module Droonga
         final_attributes = collect_output_attributes(@output["attributes"])
         @output["attributes"] = format_attributes_to_array_style(@output["attributes"])
         @output["attributes"] += collect_sort_attributes(@output["attributes"], @query["sortBy"])
-        unifiable = @output["unifiable"]
-        if unifiable && !@output["attributes"].include?("_key")
+        if unifiable? && !@output["attributes"].include?("_key")
           @output["attributes"] << "_key"
         end
 
         reducer = sort_reducer(:attributes => @output["attributes"],
-                               :sort_keys => @query["sortBy"],
-                               :unifiable => unifiable)
+                               :sort_keys => @query["sortBy"])
         # On the reducing phase, we apply only "limit". We cannot apply
         # "offset" on this phase because the collector merges a pair of
         # results step by step even if there are three or more results.
@@ -349,7 +351,7 @@ module Droonga
           "type" => "sort",
           "operators" => operators,
         }
-        if params[:unifiable] && !key_column_index.nil?
+        if unifiable? && !key_column_index.nil?
           reducer["key_column"] = key_column_index
         end
         reducer
-------------- next part --------------
HTML����������������������������...
下载 



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