Kouhei Sutou
null+****@clear*****
Mon Feb 24 13:15:09 JST 2014
Kouhei Sutou 2014-02-24 13:15:09 +0900 (Mon, 24 Feb 2014) New Revision: c6d476a869c8978be4bd86fc5564b58dbc98d760 https://github.com/groonga/groonga/commit/c6d476a869c8978be4bd86fc5564b58dbc98d760 Message: grn_obj_search: support data columns that have inverted index Modified files: lib/db.c lib/proc.c Modified: lib/db.c (+11 -0) =================================================================== --- lib/db.c 2014-02-24 13:11:42 +0900 (3c80151) +++ lib/db.c 2014-02-24 13:15:09 +0900 (f59d780) @@ -3075,6 +3075,17 @@ grn_obj_search(grn_ctx *ctx, grn_obj *obj, grn_obj *query, rc = grn_table_search(ctx, obj, key, key_size, mode, res, op); } break; + case GRN_COLUMN_FIX_SIZE : + case GRN_COLUMN_VAR_SIZE : + { + grn_obj *index; + unsigned int n_indexes; + n_indexes = grn_column_index(ctx, obj, GRN_OP_MATCH, &index, 1, NULL); + if (n_indexes > 0) { + rc = grn_obj_search(ctx, index, query, res, op, optarg); + } + } + break; case GRN_COLUMN_INDEX : if (GRN_OBJ_INVERTED_INDEX_COLUMNP(obj)) { rc = grn_obj_search_column_inverted_index(ctx, obj, query, Modified: lib/proc.c (+1 -5) =================================================================== --- lib/proc.c 2014-02-24 13:11:42 +0900 (f7cae35) +++ lib/proc.c 2014-02-24 13:15:09 +0900 (433d4e1) @@ -500,11 +500,7 @@ grn_select_apply_adjuster_adjust(grn_ctx *ctx, grn_obj *table, grn_obj *res, options.proc = NULL; options.max_size = 0; - if (GRN_OBJ_FORWARD_INDEX_COLUMNP(column)) { - grn_obj_search(ctx, column, value, res, GRN_OP_ADJUST, &options); - } else { - grn_obj_search(ctx, index, value, res, GRN_OP_ADJUST, &options); - } + grn_obj_search(ctx, column, value, res, GRN_OP_ADJUST, &options); } } -------------- next part -------------- HTML����������������������������... 下載