Yoji Shidara
null+****@clear*****
Thu Dec 19 15:44:36 JST 2013
Yoji Shidara 2013-12-19 15:44:36 +0900 (Thu, 19 Dec 2013) New Revision: 29700e15a13f06d6d4f14cfdebe2524c719c1150 https://github.com/droonga/fluent-plugin-droonga/commit/29700e15a13f06d6d4f14cfdebe2524c719c1150 Merged ce62e72: Merge branch 'refactor-searcher' Message: Access query and context via @request Modified files: lib/droonga/searcher.rb Modified: lib/droonga/searcher.rb (+5 -8) =================================================================== --- lib/droonga/searcher.rb 2013-12-19 15:36:53 +0900 (2647427) +++ lib/droonga/searcher.rb 2013-12-19 15:44:36 +0900 (4dc5c7e) @@ -118,9 +118,6 @@ module Droonga class ResultFormatter def initialize(search_request, search_result) @request = search_request - @context =****@reque***** - @query =****@reque***** - @result = search_result end @@ -140,7 +137,7 @@ module Droonga private def need_element_output?(element) - params = @query["output"] + params =****@reque*****["output"] elements = params["elements"] return false if elements.nil? @@ -158,7 +155,7 @@ module Droonga # XXX IMPLEMENT ME!!! attributes = nil - if @query["output"]["format"] == "complex" + if****@reque*****["output"]["format"] == "complex" # should convert columns to an object like: # {"_id" => {"type" => "UInt32", "vector" => false}} attributes = {} @@ -174,7 +171,7 @@ module Droonga def format_records(formatted_result) return unless need_element_output?("records") - params = @query["output"] + params =****@reque*****["output"] attributes = params["attributes"] target_attributes = normalize_target_attributes(attributes) @@ -209,7 +206,7 @@ module Droonga def record_value(record, attribute) if attribute[:source] == "_subrecs" - if @query["output"]["format"] == "complex" + if****@reque*****["output"]["format"] == "complex" record.sub_records.collect do |sub_record| target_attributes = resolve_attributes(attribute, sub_record) complex_record(target_attributes, sub_record) @@ -257,7 +254,7 @@ module Droonga expression = nil variable = nil else - expression = Groonga::Expression.new(context: @context) + expression = Groonga::Expression.new(context: @request.context) variable = expression.define_variable(domain: domain) expression.parse(source, syntax: :script) condition = expression.define_variable(name: "$condition", -------------- next part -------------- HTML����������������������������...Download