Yoji Shidara
null+****@clear*****
Tue Dec 24 19:28:01 JST 2013
Yoji Shidara 2013-12-24 19:28:01 +0900 (Tue, 24 Dec 2013) New Revision: 5a9c5fc434381d7b8efd7e4e4229305a86a8c4dd https://github.com/droonga/fluent-plugin-droonga/commit/5a9c5fc434381d7b8efd7e4e4229305a86a8c4dd Message: Directly pass operators to Rroonga Groonga::Expression#parse accepts operators in string from Rroonga 3.1.0. Reflecting the review http://sourceforge.jp/projects/groonga/lists/archive/commit/2013-December/017025.html Modified files: lib/droonga/searcher.rb Modified: lib/droonga/searcher.rb (+2 -16) =================================================================== --- lib/droonga/searcher.rb 2013-12-24 19:19:41 +0900 (c9ce5a5) +++ lib/droonga/searcher.rb 2013-12-24 19:28:01 +0900 (1206cae) @@ -153,12 +153,6 @@ module Droonga end class QuerySearcher - OPERATOR_CONVERSION_TABLE = { - "||" => Groonga::Operator::OR, - "&&" => Groonga::Operator::AND, - "-" => Groonga::Operator::BUT - }.freeze - class << self def search(search_request) new(search_request).search @@ -202,12 +196,7 @@ module Droonga if condition["query"] options[:syntax] = :query if condition["defaultOperator"] - default_operator_string = condition["defaultOperator"] - default_operator = OPERATOR_CONVERSION_TABLE[default_operator_string] - unless default_operator - raise "undefined operator assigned #{default_operator_string}" - end - options[:default_operator] = default_operator + options[:default_operator] = condition["defaultOperator"] end if condition["allowPragma"] options[:allow_pragma] = true @@ -229,10 +218,7 @@ module Droonga end def parse_condition_array(source, expression, condition) - operator = OPERATOR_CONVERSION_TABLE[condition[0]] - unless operator - raise "undefined operator assigned #{condition[0]}" - end + operator = condition[0] if condition[1] parse_condition(source, expression, condition[1]) end -------------- next part -------------- HTML����������������������������...Download