Kouhei Sutou
null+****@clear*****
Mon Jun 9 22:47:27 JST 2014
Kouhei Sutou 2014-06-09 22:47:27 +0900 (Mon, 09 Jun 2014) New Revision: 3dc3672aedc6f2e518c5d55562d175b00df4772b https://github.com/groonga/groonga/commit/3dc3672aedc6f2e518c5d55562d175b00df4772b Message: mrb: move index resolve code on match to mruby Modified files: lib/mrb/mrb_expr.c lib/mrb/scripts/scan_info.rb Modified: lib/mrb/mrb_expr.c (+2 -15) =================================================================== --- lib/mrb/mrb_expr.c 2014-06-09 00:31:37 +0900 (b0d3f75) +++ lib/mrb/mrb_expr.c 2014-06-09 22:47:27 +0900 (1eb46d4) @@ -238,21 +238,8 @@ scan_info_build(grn_ctx *ctx, grn_obj *expr, int *n, mrb_value mrb_db_obj = grn_mrb_value_from_grn_obj(mrb, *p); mrb_funcall(mrb, mrb_si, "match_resolve_index_db_obj", 1, mrb_db_obj); } else if (GRN_ACCESSORP(*p)) { - grn_scan_info_set_flags(si, grn_scan_info_get_flags(si) | SCAN_ACCESSOR); - if (grn_column_index(ctx, *p, c->op, &index, 1, &sid)) { - mrb_value mrb_accessor = grn_mrb_value_from_grn_obj(mrb, *p); - if (!mrb_nil_p(mrb_funcall(mrb, mrb_accessor, "next", 0))) { - mrb_funcall(mrb, mrb_si, "put_index", 3, - mrb_accessor, - mrb_fixnum_value(sid), - mrb_fixnum_value(1)); - } else { - mrb_funcall(mrb, mrb_si, "put_index", 3, - grn_mrb_value_from_grn_obj(mrb, index), - mrb_fixnum_value(sid), - mrb_fixnum_value(1)); - } - } + mrb_value mrb_accessor = grn_mrb_value_from_grn_obj(mrb, *p); + mrb_funcall(mrb, mrb_si, "match_resolve_index_accessor", 1, mrb_accessor); } else { mrb_value mrb_query; mrb_query = grn_mrb_value_from_grn_obj(mrb, *p); Modified: lib/mrb/scripts/scan_info.rb (+1 -1) =================================================================== --- lib/mrb/scripts/scan_info.rb 2014-06-09 00:31:37 +0900 (63e3a51) +++ lib/mrb/scripts/scan_info.rb 2014-06-09 22:47:27 +0900 (02395db) @@ -28,7 +28,7 @@ module Groonga self.flags |= Flags::ACCESSOR index_info = accessor.find_index(op) return if index_info.nil? - if acessor.next + if accessor.next put_index(accessor, index_info.section_id, 1) else put_index(index_info.index, index_info.section_id, 1) -------------- next part -------------- HTML����������������������������... Télécharger