Yoji Shidara
null+****@clear*****
Wed Jan 15 20:07:58 JST 2014
Yoji Shidara 2014-01-15 20:07:58 +0900 (Wed, 15 Jan 2014) New Revision: 4ed3d76e3a8256656176cef0ae8ab6b61291caa1 https://github.com/droonga/fluent-plugin-droonga/commit/4ed3d76e3a8256656176cef0ae8ab6b61291caa1 Message: Extract output_offset and output_limit method Modified files: lib/droonga/searcher.rb Modified: lib/droonga/searcher.rb (+13 -5) =================================================================== --- lib/droonga/searcher.rb 2014-01-15 20:02:20 +0900 (cb6622f) +++ lib/droonga/searcher.rb 2014-01-15 20:07:58 +0900 (b09b58c) @@ -407,6 +407,14 @@ module Droonga @request.output["elements"] || [] end + def output_offset + @request.output["offset"] || 0 + end + + def output_limit + @request.output["limit"] || 10 + end + def format_count @result.count end @@ -433,12 +441,12 @@ module Droonga end def format_records - params =****@reque***** - - offset = params["offset"] || 0 - limit = params["limit"] || 10 formatted_records = nil - @result.records.open_cursor(:offset => offset, :limit => limit) do |cursor| + cursor_options = { + :offset => output_offset, + :limit => output_limit + } + @result.records.open_cursor(cursor_options) do |cursor| if****@reque*****_output? formatted_records = cursor.collect do |record| complex_record(output_target_attributes, record) -------------- next part -------------- HTML����������������������������... 下載