[Groonga-commit] droonga/fluent-plugin-droonga at 6ef3988 [master] Extract have_records? method

Back to archive index

Yoji Shidara null+****@clear*****
Thu Dec 5 16:58:06 JST 2013


Yoji Shidara	2013-12-05 16:58:06 +0900 (Thu, 05 Dec 2013)

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

  Message:
    Extract have_records? method

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

  Modified: lib/droonga/plugin/distributor/distributed_search_plan.rb (+5 -6)
===================================================================
--- lib/droonga/plugin/distributor/distributed_search_plan.rb    2013-12-05 16:56:12 +0900 (deaf523)
+++ lib/droonga/plugin/distributor/distributed_search_plan.rb    2013-12-05 16:58:06 +0900 (871da1d)
@@ -139,11 +139,6 @@ module Droonga
       end
 
       def calculate_offset_and_limit!
-        have_records = false
-        if @output["elements"].include?("records")
-          have_records = true
-        end
-
         # Offset for workers must be zero, because we have to apply "limit" and
         # "offset" on the last gathering phase instead of each reducing phase.
         sort_offset = 0
@@ -153,7 +148,7 @@ module Droonga
         end
 
         output_offset = @output["offset"] || 0
-        @output["offset"] = 0 if have_records
+        @output["offset"] = 0 if have_records?
 
         final_offset = sort_offset + output_offset
 
@@ -191,6 +186,10 @@ module Droonga
         @records_limit = final_limit
       end
 
+      def have_records?
+        @output["elements"].include?("records")
+      end
+
       def rich_sort?
         @query["sortBy"].is_a?(Hash)
       end
-------------- next part --------------
HTML����������������������������...
Download 



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