Skip to content

Commit

Permalink
expr: fix a bug that extra scores were added
Browse files Browse the repository at this point in the history
  • Loading branch information
komainu8 committed May 22, 2018
1 parent 94e8fdd commit 12a9a8a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/expr.c
Expand Up @@ -4836,7 +4836,17 @@ grn_table_select(grn_ctx *ctx, grn_obj *table, grn_obj *expr,
table,
NULL);
if (base_res) {
grn_table_setoperation(ctx, base_res, res, base_res, GRN_OP_OR);
void *key = NULL, *value = NULL, *base_value = NULL;
uint32_t key_size = 0;

GRN_TABLE_EACH(ctx, res, 0, 0, id, &key, &key_size, &value, {
if (grn_table_add_v(ctx, base_res, key, key_size, &base_value, NULL)) {
grn_rset_recinfo *ri = value;
grn_rset_recinfo *base_ri = base_value;
grn_memcpy(base_ri, ri, ((grn_hash *)base_res)->value_size);
base_ri->score--;
}
});
}
}
}
Expand Down

0 comments on commit 12a9a8a

Please sign in to comment.