Navigation Menu

Skip to content

Commit

Permalink
grn_obj_search: support data columns that have inverted index
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Feb 24, 2014
1 parent faf4abc commit c6d476a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 11 additions & 0 deletions lib/db.c
Expand Up @@ -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,
Expand Down
6 changes: 1 addition & 5 deletions lib/proc.c
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit c6d476a

Please sign in to comment.