Yoji Shidara
null+****@clear*****
Thu Dec 5 19:21:01 JST 2013
Yoji Shidara 2013-12-05 19:21:01 +0900 (Thu, 05 Dec 2013) New Revision: da2c493a4108a232bead3478583c39b9e033b56a https://github.com/droonga/fluent-plugin-droonga/commit/da2c493a4108a232bead3478583c39b9e033b56a Message: Extract sort_limit method Modified files: lib/droonga/plugin/distributor/distributed_search_plan.rb Modified: lib/droonga/plugin/distributor/distributed_search_plan.rb (+8 -4) =================================================================== --- lib/droonga/plugin/distributor/distributed_search_plan.rb 2013-12-05 19:18:50 +0900 (05990cc) +++ lib/droonga/plugin/distributor/distributed_search_plan.rb 2013-12-05 19:21:01 +0900 (54323a5) @@ -153,10 +153,6 @@ module Droonga # | UNLIMITED | B | => | final_offset + B | final_offset + B | B | # | A | UNLIMITED | => | final_offset + A | final_offset + A | A | # | A | B | => | final_offset + min(A, B) | final_offset + min(A, B)| min(A, B) | - sort_limit = UNLIMITED - if rich_sort? - sort_limit = @query["sortBy"]["limit"] || UNLIMITED - end output_limit = @output["limit"] || 0 final_limit = 0 @@ -199,6 +195,14 @@ module Droonga @output["offset"] || 0 end + def sort_limit + if rich_sort? + @query["sortBy"]["limit"] || UNLIMITED + else + UNLIMITED + end + end + def calculate_output_offset! @output["offset"] = 0 if has_records? end -------------- next part -------------- HTML����������������������������... Télécharger