Daijiro MORI
null+****@clear*****
Fri Jun 21 17:57:11 JST 2013
Daijiro MORI 2013-06-21 17:57:11 +0900 (Fri, 21 Jun 2013) New Revision: 055c256be917814f5103924af93bd004ebf56818 https://github.com/groonga/fluent-plugin-droonga/commit/055c256be917814f5103924af93bd004ebf56818 Message: Support :max_n_sub_records option. Modified files: lib/droonga/plugin/handler_search.rb Modified: lib/droonga/plugin/handler_search.rb (+9 -1) =================================================================== --- lib/droonga/plugin/handler_search.rb 2013-06-19 19:02:58 +0900 (e68dbcc) +++ lib/droonga/plugin/handler_search.rb 2013-06-21 17:57:11 +0900 (763abca) @@ -203,7 +203,15 @@ module Droonga @result = source.select(expression) end if @query["groupBy"] - @result =****@resul*****(@query["groupBy"]) + if @query["groupBy"].is_a? String + @result =****@resul*****(@query["groupBy"]) + elseif @query["groupBy"].is_a? Hash + key = @query["groupBy"]["key"] + max_n_sub_records = @query["groupBy"]["maxNumSubRecords"] + @result =****@resul*****(key, :max_n_sub_records => max_n_sub_records) + else + raise '"groupBy" parameter must be a Hash or a String' + end end @count =****@resul***** if @query["sortBy"] -------------- next part -------------- HTML����������������������������...Download