Yoji Shidara
null+****@clear*****
Thu Dec 19 15:02:53 JST 2013
Yoji Shidara 2013-12-19 15:02:53 +0900 (Thu, 19 Dec 2013) New Revision: c64f45260a34ba144f8ce58f48d8098d327d77fd https://github.com/droonga/fluent-plugin-droonga/commit/c64f45260a34ba144f8ce58f48d8098d327d77fd Merged ce62e72: Merge branch 'refactor-searcher' Message: Access attributes on SearchResult via @result Modified files: lib/droonga/searcher.rb Modified: lib/droonga/searcher.rb (+6 -11) =================================================================== --- lib/droonga/searcher.rb 2013-12-19 14:57:52 +0900 (bb500e0) +++ lib/droonga/searcher.rb 2013-12-19 15:02:53 +0900 (11400a4) @@ -121,11 +121,6 @@ module Droonga @query =****@reque***** @result = search_result - @records =****@resul***** - @start_time =****@resul*****_time - @end_time =****@resul*****_time - @count =****@resul***** - @condition =****@resul***** end def format @@ -134,10 +129,10 @@ module Droonga format_attributes(formatted_result) format_records(formatted_result) if need_element_output?("startTime") - formatted_result["startTime"] = @start_time.iso8601 + formatted_result["startTime"] =****@resul*****_time.iso8601 end if need_element_output?("elapsedTime") - formatted_result["elapsedTime"] = @end_time.to_f - @start_time.to_f + formatted_result["elapsedTime"] =****@resul*****_time.to_f -****@resul*****_time.to_f end formatted_result end @@ -154,7 +149,7 @@ module Droonga def format_count(formatted_result) return unless need_element_output?("count") - formatted_result["count"] = @count + formatted_result["count"] =****@resul***** end def format_attributes(formatted_result) @@ -184,7 +179,7 @@ module Droonga target_attributes = normalize_target_attributes(attributes) offset = params["offset"] || 0 limit = params["limit"] || 10 - @records.open_cursor(:offset => offset, :limit => limit) do |cursor| + @result.records.open_cursor(:offset => offset, :limit => limit) do |cursor| if params["format"] == "complex" formatted_result["records"] = cursor.collect do |record| complex_record(target_attributes, record) @@ -249,7 +244,7 @@ module Droonga return attribute[:target_attributes] end - def normalize_target_attributes(attributes, domain = @records) + def normalize_target_attributes(attributes, domain =****@resul*****) attributes.collect do |attribute| if attribute.is_a?(String) attribute = { @@ -266,7 +261,7 @@ module Droonga expression.parse(source, syntax: :script) condition = expression.define_variable(name: "$condition", reference: true) - condition.value = @condition + condition.value =****@resul***** source = nil end { -------------- next part -------------- HTML����������������������������...Download