[Groonga-commit] groonga/groonga at 8a81705 [master] mrb: implement resolving index on match operation

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Jun 8 18:03:33 JST 2014


Kouhei Sutou	2014-06-08 18:03:33 +0900 (Sun, 08 Jun 2014)

  New Revision: 8a81705ccdfe8e0de49fda3baae85c27586a04fd
  https://github.com/groonga/groonga/commit/8a81705ccdfe8e0de49fda3baae85c27586a04fd

  Message:
    mrb: implement resolving index on match operation

  Modified files:
    lib/mrb/mrb_expr.c
    lib/mrb/scripts/scan_info.rb

  Modified: lib/mrb/mrb_expr.c (+2 -6)
===================================================================
--- lib/mrb/mrb_expr.c    2014-06-08 17:58:11 +0900 (f69c85e)
+++ lib/mrb/mrb_expr.c    2014-06-08 18:03:33 +0900 (a157b0a)
@@ -237,12 +237,8 @@ scan_info_build(grn_ctx *ctx, grn_obj *expr, int *n,
               }
             }
           } else if (GRN_DB_OBJP(*p)) {
-            if (grn_column_index(ctx, *p, c->op, &index, 1, &sid)) {
-              mrb_funcall(mrb, mrb_si, "put_index", 3,
-                          mrb_cptr_value(mrb, index),
-                          mrb_fixnum_value(sid),
-                          mrb_fixnum_value(1));
-            }
+            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)) {

  Modified: lib/mrb/scripts/scan_info.rb (+6 -0)
===================================================================
--- lib/mrb/scripts/scan_info.rb    2014-06-08 17:58:11 +0900 (ce58955)
+++ lib/mrb/scripts/scan_info.rb    2014-06-08 18:03:33 +0900 (173506b)
@@ -18,6 +18,12 @@ module Groonga
       nil
     end
 
+    def match_resolve_index_db_obj(db_obj)
+      index_info = db_obj.find_index(op)
+      return if index_info.nil?
+      put_index(index_info.index, index_info.section_id, 1)
+    end
+
     def call_relational_resolve_indexes
       # better index resolving framework for functions should be implemented
       each_arg do |arg|
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index