Kouhei Sutou
null+****@clear*****
Mon Jun 9 23:22:51 JST 2014
Kouhei Sutou 2014-06-09 23:22:51 +0900 (Mon, 09 Jun 2014) New Revision: 62f32f4a454922230b9be741bd68a769699e6449 https://github.com/groonga/groonga/commit/62f32f4a454922230b9be741bd68a769699e6449 Message: mrb: implement resolving index of data column in expr on match by mruby Modified files: lib/mrb/mrb_expr.c lib/mrb/scripts/scan_info.rb Modified: lib/mrb/mrb_expr.c (+9 -7) =================================================================== --- lib/mrb/mrb_expr.c 2014-06-09 23:20:17 +0900 (bd09a41) +++ lib/mrb/mrb_expr.c 2014-06-09 23:22:51 +0900 (f75fcff) @@ -193,13 +193,15 @@ scan_info_build(grn_ctx *ctx, grn_obj *expr, int *n, break; case GRN_COLUMN_FIX_SIZE : case GRN_COLUMN_VAR_SIZE : - if (grn_column_index(ctx, ec->value, c->op, &index, 1, &sid)) { - mrb_value mrb_ec = mrb_grn_expr_code_new(mrb, ec); - weight = mrb_fixnum(mrb_funcall(mrb, mrb_ec, "weight", 0)); - mrb_funcall(mrb, mrb_si, "put_index", 3, - grn_mrb_value_from_grn_obj(mrb, index), - mrb_fixnum_value(sid), - mrb_fixnum_value(weight)); + { + mrb_value mrb_column; + mrb_value mrb_ec; + + mrb_column = grn_mrb_value_from_grn_obj(mrb, ec->value); + mrb_ec = mrb_grn_expr_code_new(mrb, ec); + mrb_funcall(mrb, mrb_si, + "match_expr_resolve_index_data_column", + 2, mrb_column, mrb_ec); } break; case GRN_COLUMN_INDEX : Modified: lib/mrb/scripts/scan_info.rb (+6 -0) =================================================================== --- lib/mrb/scripts/scan_info.rb 2014-06-09 23:20:17 +0900 (af529d7) +++ lib/mrb/scripts/scan_info.rb 2014-06-09 23:22:51 +0900 (44c6e19) @@ -29,6 +29,12 @@ module Groonga end end + def match_expr_resolve_index_data_column(column, expr_code) + index_info = column.find_index(op) + return if index_info.nil? + put_index(index_info.index, index_info.section_id, expr_code.weight) + end + def match_resolve_index_db_obj(db_obj) index_info = db_obj.find_index(op) return if index_info.nil? -------------- next part -------------- HTML����������������������������... ダウンロード