Kouhei Sutou
null+****@clear*****
Wed Mar 5 18:24:55 JST 2014
Kouhei Sutou 2014-03-05 18:24:55 +0900 (Wed, 05 Mar 2014) New Revision: 679f5bc6c38c88f2f3815013a074b455f7511091 https://github.com/groonga/groonga/commit/679f5bc6c38c88f2f3815013a074b455f7511091 Message: Support loading/outputting weight vector Use the following command to use weight vector: column_create ${TABLE_NAME} ${COLUMN_NAME} COLUMN_VECTOR|WITH_WEIGHT ${TYPE} Forward index is dropped. You can't use other table for ${TYPE} for now. It will be supported in the future. Added files: test/command/suite/dump/record/weight_vector_type.expected test/command/suite/load/vector/add/weight/array/invalid/normal_vector.expected test/command/suite/load/vector/add/weight/object/invalid/normal_vector.expected Copied files: test/command/suite/dump/record/weight_vector_reference.test (from test/command/suite/dump/record/forward_index.test) test/command/suite/load/vector/add/weight/array/invalid/normal_vector.test (from test/command/suite/load/index/forward/array/value_weight.test) test/command/suite/load/vector/add/weight/object/invalid/normal_vector.test (from test/command/suite/load/index/forward/object/value_weight.test) test/command/suite/select/output/value/weight_vector/reference.expected (from test/command/suite/select/output/value/forward_index.expected) test/command/suite/select/output/value/weight_vector/reference.test (from test/command/suite/select/output/value/forward_index.test) Modified files: include/groonga.h lib/db.c lib/db.h lib/expr.c lib/output.c lib/proc.c lib/str.c test/command/suite/select/adjuster/multiple.expected test/command/suite/select/adjuster/multiple.test test/command/suite/select/adjuster/no_factor.expected test/command/suite/select/adjuster/no_factor.test test/command/suite/select/adjuster/not_all_match.expected test/command/suite/select/adjuster/not_all_match.test test/command/suite/select/adjuster/one.expected test/command/suite/select/adjuster/one.test Renamed files: test/command/suite/dump/record/weight_vector_reference.expected (from test/command/suite/dump/record/forward_index.expected) test/command/suite/dump/record/weight_vector_type.test (from test/command/suite/dump/record/forward_index.test) test/command/suite/load/vector/add/weight/array/invalid/scalar.expected (from test/command/suite/load/index/forward/array/invalid/not_index_column.expected) test/command/suite/load/vector/add/weight/array/invalid/scalar.test (from test/command/suite/load/index/forward/array/invalid/not_index_column.test) test/command/suite/load/vector/add/weight/array/value_weight.expected (from test/command/suite/load/index/forward/array/value_weight.expected) test/command/suite/load/vector/add/weight/array/value_weight.test (from test/command/suite/load/index/forward/array/value_weight.test) test/command/suite/load/vector/add/weight/object/invalid/scalar.expected (from test/command/suite/load/index/forward/object/invalid/not_index_column.expected) test/command/suite/load/vector/add/weight/object/invalid/scalar.test (from test/command/suite/load/index/forward/object/invalid/not_index_column.test) test/command/suite/load/vector/add/weight/object/value_weight.expected (from test/command/suite/load/index/forward/object/value_weight.expected) test/command/suite/load/vector/add/weight/object/value_weight.test (from test/command/suite/load/index/forward/object/value_weight.test) test/command/suite/select/adjuster/not_weight_vector.expected (from test/command/suite/select/adjuster/not_forward_index.expected) test/command/suite/select/adjuster/not_weight_vector.test (from test/command/suite/select/adjuster/not_forward_index.test) test/command/suite/select/match_columns/weight/nested_weight_vector.expected (from test/command/suite/select/match_columns/weight/nested_forward_index.expected) test/command/suite/select/match_columns/weight/nested_weight_vector.test (from test/command/suite/select/match_columns/weight/nested_forward_index.test) test/command/suite/select/match_columns/weight/weight_vector.expected (from test/command/suite/select/match_columns/weight/forward_index.expected) test/command/suite/select/match_columns/weight/weight_vector.test (from test/command/suite/select/match_columns/weight/forward_index.test) test/command/suite/select/output/value/weight_vector/type.expected (from test/command/suite/select/output/value/forward_index.expected) test/command/suite/select/output/value/weight_vector/type.test (from test/command/suite/select/output/value/forward_index.test) test/command/suite/select/query/weight_vector.expected (from test/command/suite/select/query/forward_index.expected) test/command/suite/select/query/weight_vector.test (from test/command/suite/select/query/forward_index.test) Modified: include/groonga.h (+1 -1) =================================================================== --- include/groonga.h 2014-03-05 12:24:24 +0900 (ee7216b) +++ include/groonga.h 2014-03-05 18:24:55 +0900 (baceb4f) @@ -1208,7 +1208,7 @@ typedef struct _grn_obj_format grn_obj_format; /* Deprecated since 4.0.1. It will be remov****@5*****. Use GRN_OBJ_FORMAT_AS_ARRAY instead.*/ #define GRN_OBJ_FORMAT_ASARRAY GRN_OBJ_FORMAT_AS_ARRAY -#define GRN_OBJ_FORMAT_AS_FORWARD_INDEX (0x01<<4) +#define GRN_OBJ_FORMAT_WITH_WEIGHT (0x01<<4) struct _grn_obj_format { grn_obj columns; Modified: lib/db.c (+31 -169) =================================================================== --- lib/db.c 2014-03-05 12:24:24 +0900 (b25bb68) +++ lib/db.c 2014-03-05 18:24:55 +0900 (77369d6) @@ -2760,7 +2760,7 @@ grn_obj_search_accessor(grn_ctx *ctx, grn_obj *obj, grn_obj *query, n_accessors = 0; for (a = (grn_accessor *)obj; a; a = a->next) { n_accessors++; - if (GRN_OBJ_INVERTED_INDEX_COLUMNP(a->obj)) { + if (GRN_OBJ_INDEX_COLUMNP(a->obj)) { break; } } @@ -2822,10 +2822,10 @@ exit : } static grn_rc -grn_obj_search_column_inverted_index_by_id(grn_ctx *ctx, grn_obj *obj, - grn_id tid, - grn_obj *res, grn_operator op, - grn_search_optarg *optarg) +grn_obj_search_column_index_by_id(grn_ctx *ctx, grn_obj *obj, + grn_id tid, + grn_obj *res, grn_operator op, + grn_search_optarg *optarg) { grn_ii_cursor *c = grn_ii_cursor_open(ctx, (grn_ii *)obj, tid, GRN_ID_NIL, GRN_ID_MAX, 1, 0); @@ -2846,10 +2846,10 @@ grn_obj_search_column_inverted_index_by_id(grn_ctx *ctx, grn_obj *obj, } static grn_rc -grn_obj_search_column_inverted_index_by_key(grn_ctx *ctx, grn_obj *obj, - grn_obj *query, - grn_obj *res, grn_operator op, - grn_search_optarg *optarg) +grn_obj_search_column_index_by_key(grn_ctx *ctx, grn_obj *obj, + grn_obj *query, + grn_obj *res, grn_operator op, + grn_search_optarg *optarg) { grn_rc rc; unsigned int key_type = GRN_ID_NIL; @@ -2889,9 +2889,9 @@ grn_obj_search_column_inverted_index_by_key(grn_ctx *ctx, grn_obj *obj, } static grn_rc -grn_obj_search_column_inverted_index(grn_ctx *ctx, grn_obj *obj, grn_obj *query, - grn_obj *res, grn_operator op, - grn_search_optarg *optarg) +grn_obj_search_column_index(grn_ctx *ctx, grn_obj *obj, grn_obj *query, + grn_obj *res, grn_operator op, + grn_search_optarg *optarg) { grn_rc rc = GRN_INVALID_ARGUMENT; @@ -2901,11 +2901,10 @@ grn_obj_search_column_inverted_index(grn_ctx *ctx, grn_obj *obj, grn_obj *query, if (query->header.domain == obj->header.domain && GRN_BULK_VSIZE(query) == sizeof(grn_id)) { grn_id tid = GRN_RECORD_VALUE(query); - rc = grn_obj_search_column_inverted_index_by_id(ctx, obj, tid, - res, op, optarg); + rc = grn_obj_search_column_index_by_id(ctx, obj, tid, res, op, optarg); } else { - rc = grn_obj_search_column_inverted_index_by_key(ctx, obj, query, - res, op, optarg); + rc = grn_obj_search_column_index_by_key(ctx, obj, query, + res, op, optarg); } break; case GRN_QUERY : @@ -2940,10 +2939,7 @@ grn_obj_search(grn_ctx *ctx, grn_obj *obj, grn_obj *query, } break; case GRN_COLUMN_INDEX : - if (GRN_OBJ_INVERTED_INDEX_COLUMNP(obj)) { - rc = grn_obj_search_column_inverted_index(ctx, obj, query, - res, op, optarg); - } + rc = grn_obj_search_column_index(ctx, obj, query, res, op, optarg); break; } } @@ -5683,93 +5679,13 @@ static grn_rc grn_obj_set_value_column_index(grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value, int flags) { - grn_id range_id; - grn_obj *range; - - if (!GRN_OBJ_FORWARD_INDEX_COLUMNP(obj)) { - char column_name[GRN_TABLE_MAX_KEY_SIZE]; - int column_name_size; - column_name_size = grn_obj_name(ctx, obj, column_name, - GRN_TABLE_MAX_KEY_SIZE); - ERR(GRN_INVALID_ARGUMENT, - "can't set value to not forward index column directly: <%.*s>", - column_name_size, column_name); - return ctx->rc; - } - - if (value->header.type != GRN_VECTOR) { - grn_obj inspected; - GRN_TEXT_INIT(&inspected, 0); - grn_inspect(ctx, value, &inspected); - ERR(GRN_INVALID_ARGUMENT, - "index value must be a vector: <%.*s>", - (int)GRN_TEXT_LEN(&inspected), - GRN_TEXT_VALUE(&inspected)); - GRN_OBJ_FIN(ctx, &inspected); - return ctx->rc; - } - - range_id = DB_OBJ(obj)->range; - range = grn_ctx_at(ctx, range_id); - if (!range) { - char column_name[GRN_TABLE_MAX_KEY_SIZE]; - int column_name_size; - column_name_size = grn_obj_name(ctx, obj, column_name, - GRN_TABLE_MAX_KEY_SIZE); - ERR(GRN_INVALID_ARGUMENT, - "<%.*s>: dangling range reference: <%d>", - column_name_size, column_name, - range_id); - return ctx->rc; - } - - if (call_hook(ctx, obj, id, value, flags)) { - return GRN_INVALID_ARGUMENT; - } - - { - unsigned int i, n; - grn_obj key_buffer; - grn_obj token_buffer; - - n = grn_vector_size(ctx, value); - GRN_VOID_INIT(&key_buffer); - GRN_RECORD_INIT(&token_buffer, 0, range_id); - for (i = 0; i < n; i++) { - grn_rc rc; - const char *key; - unsigned int key_length; - unsigned int weight; - grn_id domain_id; - grn_ii_updspec *update_spec; - grn_id token_id; - - key_length = grn_vector_get_element(ctx, value, i, - &key, &weight, &domain_id); - if (ctx->rc != GRN_SUCCESS) { - break; - } - grn_obj_reinit(ctx, &key_buffer, domain_id, 0); - grn_bulk_write(ctx, &key_buffer, key, key_length); - GRN_BULK_REWIND(&token_buffer); - rc = grn_obj_cast(ctx, &key_buffer, &token_buffer, GRN_TRUE); - if (rc != GRN_SUCCESS) { - ERR_CAST(obj, range, value); - break; - } - token_id = GRN_RECORD_VALUE(&token_buffer); - - update_spec = grn_ii_updspec_open(ctx, token_id, 1); - grn_ii_updspec_add(ctx, update_spec, 0, weight); - grn_ii_update_one(ctx, (grn_ii *)obj, id, update_spec, NULL); - grn_ii_updspec_close(ctx, update_spec); - } - GRN_OBJ_FIN(ctx, &key_buffer); - GRN_OBJ_FIN(ctx, &token_buffer); - } - - grn_obj_unlink(ctx, range); - + char column_name[GRN_TABLE_MAX_KEY_SIZE]; + int column_name_size; + column_name_size = grn_obj_name(ctx, obj, column_name, + GRN_TABLE_MAX_KEY_SIZE); + ERR(GRN_INVALID_ARGUMENT, + "can't set value to index column directly: <%.*s>", + column_name_size, column_name); return ctx->rc; } @@ -5870,51 +5786,8 @@ grn_obj_get_value_(grn_ctx *ctx, grn_obj *obj, grn_id id, uint32_t *size) } static void -grn_obj_get_value_column_index_forward(grn_ctx *ctx, grn_obj *index_column, - grn_id id, grn_obj *value) -{ - grn_ii *ii = (grn_ii *)index_column; - grn_ii_cursor *ii_cursor; - int flags = GRN_OBJ_WITH_WEIGHT; - - grn_obj_ensure_vector(ctx, value); - - ii_cursor = grn_ii_cursor_open(ctx, ii, id, GRN_ID_NIL, GRN_ID_MAX, - ii->n_elements, flags); - if (ii_cursor) { - grn_ii_posting *posting; - grn_obj *range; - grn_obj key; - grn_obj *key_accessor; - - range = grn_ctx_at(ctx, grn_obj_get_range(ctx, index_column)); - - GRN_TEXT_INIT(&key, 0); - key_accessor = grn_obj_column(ctx, range, - GRN_COLUMN_NAME_KEY, - GRN_COLUMN_NAME_KEY_LEN); - while ((posting = grn_ii_cursor_next(ctx, ii_cursor))) { - GRN_BULK_REWIND(&key); - grn_obj_get_value(ctx, key_accessor, posting->rid, &key); - grn_vector_add_element(ctx, - value, - GRN_BULK_HEAD(&key), - GRN_BULK_VSIZE(&key), - posting->weight, - key.header.domain); - } - grn_obj_unlink(ctx, key_accessor); - GRN_OBJ_FIN(ctx, &key); - - grn_obj_unlink(ctx, range); - - grn_ii_cursor_close(ctx, ii_cursor); - } -} - -static void -grn_obj_get_value_column_index_normal(grn_ctx *ctx, grn_obj *index_column, - grn_id id, grn_obj *value) +grn_obj_get_value_column_index(grn_ctx *ctx, grn_obj *index_column, + grn_id id, grn_obj *value) { grn_ii *ii = (grn_ii *)index_column; grn_obj_ensure_bulk(ctx, value); @@ -5922,17 +5795,6 @@ grn_obj_get_value_column_index_normal(grn_ctx *ctx, grn_obj *index_column, value->header.domain = GRN_DB_UINT32; } -static void -grn_obj_get_value_column_index(grn_ctx *ctx, grn_obj *index_column, - grn_id id, grn_obj *value) -{ - if (GRN_OBJ_FORWARD_INDEX_COLUMNP(index_column)) { - grn_obj_get_value_column_index_forward(ctx, index_column, id, value); - } else { - grn_obj_get_value_column_index_normal(ctx, index_column, id, value); - } -} - grn_obj * grn_obj_get_value(grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value) { @@ -9183,7 +9045,7 @@ grn_column_index_accessor(grn_ctx *ctx, grn_obj *obj, grn_operator op, grn_hook_entry entry = -1; if (a->action == GRN_ACCESSOR_GET_COLUMN_VALUE && - GRN_OBJ_INVERTED_INDEX_COLUMNP(a->obj)) { + GRN_OBJ_INDEX_COLUMNP(a->obj)) { return grn_column_index_accessor_index_column(ctx, a, op, indexbuf, buf_size, section); } @@ -9742,15 +9604,15 @@ set_vector(grn_ctx *ctx, grn_obj *column, grn_id id, grn_obj *vector) } static void -set_index_value(grn_ctx *ctx, grn_obj *column, grn_id id, grn_obj *index_value) +set_weight_vector(grn_ctx *ctx, grn_obj *column, grn_id id, grn_obj *index_value) { - if (column->header.type != GRN_COLUMN_INDEX) { + if (!GRN_OBJ_WEIGHT_VECTOR_COLUMNP(column)) { char column_name[GRN_TABLE_MAX_KEY_SIZE]; int column_name_size; column_name_size = grn_obj_name(ctx, column, column_name, GRN_TABLE_MAX_KEY_SIZE); ERR(GRN_INVALID_ARGUMENT, - "<%.*s>: columns except index column don't support object value", + "<%.*s>: columns except weight vector column don't support object value", column_name_size, column_name); return; } @@ -9939,7 +9801,7 @@ bracket_close(grn_ctx *ctx, grn_loader *loader) if (value->header.domain == GRN_JSON_LOAD_OPEN_BRACKET) { set_vector(ctx, column, id, value); } else if (value->header.domain == GRN_JSON_LOAD_OPEN_BRACE) { - set_index_value(ctx, column, id, value); + set_weight_vector(ctx, column, id, value); } else { grn_obj_set_value(ctx, column, id, value, GRN_OBJ_SET); } @@ -10049,7 +9911,7 @@ brace_close(grn_ctx *ctx, grn_loader *loader) if (value->header.domain == GRN_JSON_LOAD_OPEN_BRACKET) { set_vector(ctx, col, id, value); } else if (value->header.domain == GRN_JSON_LOAD_OPEN_BRACE) { - set_index_value(ctx, col, id, value); + set_weight_vector(ctx, col, id, value); } else { grn_obj_set_value(ctx, col, id, value, GRN_OBJ_SET); } Modified: lib/db.h (+9 -6) =================================================================== --- lib/db.h 2014-03-05 12:24:24 +0900 (c7f5676) +++ lib/db.h 2014-03-05 18:24:55 +0900 (11e25ee) @@ -143,15 +143,18 @@ struct _grn_type { (GRN_TABLE_HASH_KEY <= ((grn_db_obj *)obj)->header.type) &&\ (((grn_db_obj *)obj)->header.type <= GRN_DB)) -#define GRN_OBJ_INVERTED_INDEX_COLUMNP(obj) \ +#define GRN_OBJ_INDEX_COLUMNP(obj) \ (obj &&\ - DB_OBJ(obj)->header.type == GRN_COLUMN_INDEX &&\ - DB_OBJ(obj)->source_size > 0) + DB_OBJ(obj)->header.type == GRN_COLUMN_INDEX) -#define GRN_OBJ_FORWARD_INDEX_COLUMNP(obj) \ +#define GRN_OBJ_VECTOR_COLUMNP(obj) \ (obj &&\ - DB_OBJ(obj)->header.type == GRN_COLUMN_INDEX &&\ - DB_OBJ(obj)->source_size == 0) + DB_OBJ(obj)->header.type == GRN_COLUMN_VAR_SIZE &&\ + (DB_OBJ(obj)->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) == GRN_OBJ_COLUMN_VECTOR) + +#define GRN_OBJ_WEIGHT_VECTOR_COLUMNP(obj) \ + (GRN_OBJ_VECTOR_COLUMNP(obj) &&\ + (DB_OBJ(obj)->header.flags & GRN_OBJ_WITH_WEIGHT)) typedef grn_rc grn_selector_func(grn_ctx *ctx, grn_obj *table, grn_obj *index, int nargs, grn_obj **args, Modified: lib/expr.c (+7 -32) =================================================================== --- lib/expr.c 2014-03-05 12:24:24 +0900 (46baf69) +++ lib/expr.c 2014-03-05 18:24:55 +0900 (5126c41) @@ -4295,29 +4295,11 @@ grn_scan_info_get_arg(grn_ctx *ctx, scan_info *si, int i) } static uint32_t -scan_info_build_find_index_column_forward_index(grn_ctx *ctx, - scan_info *si, - grn_expr_code *ec, - uint32_t n_rest_codes, - grn_operator op) -{ - uint32_t offset = 0; - grn_obj *index; - int sid; - - if (grn_column_index(ctx, ec->value, op, &index, 1, &sid)) { - scan_info_put_index(ctx, si, index, sid, get_weight(ctx, ec)); - } - - return offset; -} - -static uint32_t -scan_info_build_find_index_column_inverted_index(grn_ctx *ctx, - scan_info *si, - grn_expr_code *ec, - uint32_t n_rest_codes, - grn_operator op) +scan_info_build_find_index_column_index(grn_ctx *ctx, + scan_info *si, + grn_expr_code *ec, + uint32_t n_rest_codes, + grn_operator op) { uint32_t offset = 0; grn_obj *index; @@ -4474,15 +4456,8 @@ scan_info_build(grn_ctx *ctx, grn_obj *expr, int *n, case GRN_COLUMN_INDEX : { uint32_t offset; - if (GRN_OBJ_FORWARD_INDEX_COLUMNP(ec->value)) { - offset = - scan_info_build_find_index_column_forward_index( - ctx, si, ec, j, c->op); - } else { - offset = - scan_info_build_find_index_column_inverted_index( - ctx, si, ec, j, c->op); - } + offset = scan_info_build_find_index_column_index(ctx, si, ec, + j, c->op); j -= offset; ec += offset; } Modified: lib/output.c (+34 -39) =================================================================== --- lib/output.c 2014-03-05 12:24:24 +0900 (7b34be8) +++ lib/output.c 2014-03-05 18:24:55 +0900 (518d6b9) @@ -578,39 +578,39 @@ grn_text_atoj(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, } grn_output_obj(ctx, outbuf, output_type, &buf, NULL); } else { - if (GRN_OBJ_FORWARD_INDEX_COLUMNP(obj)) { - grn_obj_format format; - format.flags = GRN_OBJ_FORMAT_AS_FORWARD_INDEX; - GRN_VOID_INIT(&buf); - grn_obj_get_value(ctx, obj, id, &buf); - grn_output_obj(ctx, outbuf, output_type, &buf, &format); - } else { - switch (obj->header.type) { - case GRN_COLUMN_FIX_SIZE : - GRN_VALUE_FIX_SIZE_INIT(&buf, 0, DB_OBJ(obj)->range); - break; - case GRN_COLUMN_VAR_SIZE : - if ((obj->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) == GRN_OBJ_COLUMN_VECTOR) { - grn_obj *range = grn_ctx_at(ctx, DB_OBJ(obj)->range); - if (range->header.flags & GRN_OBJ_KEY_VAR_SIZE) { - GRN_VALUE_VAR_SIZE_INIT(&buf, GRN_OBJ_VECTOR, DB_OBJ(obj)->range); - } else { - GRN_VALUE_FIX_SIZE_INIT(&buf, GRN_OBJ_VECTOR, DB_OBJ(obj)->range); - } + grn_obj_format *format_argument = NULL; + grn_obj_format format; + format.flags = 0; + switch (obj->header.type) { + case GRN_COLUMN_FIX_SIZE : + GRN_VALUE_FIX_SIZE_INIT(&buf, 0, DB_OBJ(obj)->range); + break; + case GRN_COLUMN_VAR_SIZE : + if ((obj->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) == GRN_OBJ_COLUMN_VECTOR) { + grn_obj *range = grn_ctx_at(ctx, DB_OBJ(obj)->range); + if (GRN_OBJ_TABLEP(range) || + (range->header.flags & GRN_OBJ_KEY_VAR_SIZE) == 0) { + GRN_VALUE_FIX_SIZE_INIT(&buf, GRN_OBJ_VECTOR, DB_OBJ(obj)->range); } else { - GRN_VALUE_VAR_SIZE_INIT(&buf, 0, DB_OBJ(obj)->range); + GRN_VALUE_VAR_SIZE_INIT(&buf, GRN_OBJ_VECTOR, DB_OBJ(obj)->range); + if (obj->header.flags & GRN_OBJ_WITH_WEIGHT) { + format.flags |= GRN_OBJ_FORMAT_WITH_WEIGHT; + format_argument = &format; + } } - break; - case GRN_COLUMN_INDEX : - GRN_UINT32_INIT(&buf, 0); - break; - default: - GRN_TEXT_INIT(&buf, 0); - break; + } else { + GRN_VALUE_VAR_SIZE_INIT(&buf, 0, DB_OBJ(obj)->range); } - grn_obj_get_value(ctx, obj, id, &buf); - grn_output_obj(ctx, outbuf, output_type, &buf, NULL); + break; + case GRN_COLUMN_INDEX : + GRN_UINT32_INIT(&buf, 0); + break; + default: + GRN_TEXT_INIT(&buf, 0); + break; } + grn_obj_get_value(ctx, obj, id, &buf); + grn_output_obj(ctx, outbuf, output_type, &buf, format_argument); } exit : grn_obj_close(ctx, &buf); @@ -873,7 +873,7 @@ static inline void grn_output_vector(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, grn_obj *vector, grn_obj_format *format) { - grn_bool as_forward_index = GRN_FALSE; + grn_bool with_weight = GRN_FALSE; if (vector->header.domain == GRN_DB_VOID) { ERR(GRN_INVALID_ARGUMENT, "invalid obj->header.domain"); @@ -881,23 +881,18 @@ grn_output_vector(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type, } if (format) { - if (format->flags & GRN_OBJ_FORMAT_AS_FORWARD_INDEX) { - as_forward_index = GRN_TRUE; - } else { - ERR(GRN_FUNCTION_NOT_IMPLEMENTED, - "cannot print GRN_VECTOR using grn_obj_format " - "without GRN_OBJ_FORMAT_AS_FORWARD_INDEX flag"); - return; + if (format->flags & GRN_OBJ_FORMAT_WITH_WEIGHT) { + with_weight = GRN_TRUE; } } - if (as_forward_index) { + if (with_weight) { unsigned int i, n; grn_obj value; GRN_VOID_INIT(&value); n = grn_vector_size(ctx, vector); - grn_output_map_open(ctx, outbuf, output_type, "FORWARD_INDEX", n); + grn_output_map_open(ctx, outbuf, output_type, "WEIGHT_VECTOR", n); for (i = 0; i < n; i++) { const char *_value; unsigned int weight, length; Modified: lib/proc.c (+25 -67) =================================================================== --- lib/proc.c 2014-03-05 12:24:24 +0900 (d2c7c53) +++ lib/proc.c 2014-03-05 18:24:55 +0900 (aa8bc83) @@ -2283,52 +2283,30 @@ dump_columns(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table, } static void -dump_record_column_forward_index(grn_ctx *ctx, grn_obj *outbuf, - grn_id id, grn_obj *index_column) +dump_record_column_vector(grn_ctx *ctx, grn_obj *outbuf, grn_id id, + grn_obj *column, grn_id range_id, grn_obj *buf) { - grn_ii *ii = (grn_ii *)index_column; - grn_ii_cursor *ii_cursor; - int flags = GRN_OBJ_WITH_WEIGHT; - - GRN_TEXT_PUTC(ctx, outbuf, '{'); - ii_cursor = grn_ii_cursor_open(ctx, ii, id, GRN_ID_NIL, GRN_ID_MAX, - ii->n_elements, flags); - if (ii_cursor) { - int i = 0; - grn_ii_posting *posting; - grn_obj *range; - grn_obj key, weight; - grn_obj *key_accessor; - - range = grn_ctx_at(ctx, grn_obj_get_range(ctx, index_column)); - - GRN_TEXT_INIT(&key, 0); - GRN_UINT32_INIT(&weight, 0); - key_accessor = grn_obj_column(ctx, range, - GRN_COLUMN_NAME_KEY, - GRN_COLUMN_NAME_KEY_LEN); - while ((posting = grn_ii_cursor_next(ctx, ii_cursor))) { - if (i > 0) { - GRN_TEXT_PUTC(ctx, outbuf, ','); - } - GRN_BULK_REWIND(&key); - GRN_BULK_REWIND(&weight); - grn_obj_get_value(ctx, key_accessor, posting->rid, &key); - GRN_UINT32_SET(ctx, &weight, posting->weight); - grn_text_otoj(ctx, outbuf, &key, NULL); - GRN_TEXT_PUTC(ctx, outbuf, ':'); - grn_text_otoj(ctx, outbuf, &weight, NULL); - i++; - } - grn_obj_unlink(ctx, key_accessor); - GRN_OBJ_FIN(ctx, &key); - GRN_OBJ_FIN(ctx, &weight); - - grn_obj_unlink(ctx, range); + grn_obj *range; - grn_ii_cursor_close(ctx, ii_cursor); + range = grn_ctx_at(ctx, range_id); + if (GRN_OBJ_TABLEP(range) || + (range->header.flags & GRN_OBJ_KEY_VAR_SIZE) == 0) { + GRN_OBJ_INIT(buf, GRN_UVECTOR, 0, range_id); + grn_obj_get_value(ctx, column, id, buf); + grn_text_otoj(ctx, outbuf, buf, NULL); + } else { + grn_obj_format *format_argument = NULL; + grn_obj_format format; + if (column->header.flags & GRN_OBJ_WITH_WEIGHT) { + format.flags = GRN_OBJ_FORMAT_WITH_WEIGHT; + format_argument = &format; + } + GRN_OBJ_INIT(buf, GRN_VECTOR, 0, range_id); + grn_obj_get_value(ctx, column, id, buf); + grn_text_otoj(ctx, outbuf, buf, format_argument); } - GRN_TEXT_PUTC(ctx, outbuf, '}'); + grn_obj_unlink(ctx, range); + grn_obj_unlink(ctx, buf); } static void @@ -2368,8 +2346,7 @@ dump_records(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table) GRN_PTR_INIT(&use_columns, GRN_OBJ_VECTOR, GRN_ID_NIL); GRN_TEXT_INIT(&column_name, 0); for (i = 0; i < ncolumns; i++) { - if (columns[i]->header.type == GRN_COLUMN_INDEX && - !GRN_OBJ_FORWARD_INDEX_COLUMNP(columns[i])) { + if (GRN_OBJ_INDEX_COLUMNP(columns[i])) { continue; } GRN_BULK_REWIND(&column_name); @@ -2443,25 +2420,9 @@ dump_records(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table) switch (column->header.type) { case GRN_COLUMN_VAR_SIZE: case GRN_COLUMN_FIX_SIZE: - case GRN_COLUMN_INDEX: switch (column->header.flags & GRN_OBJ_COLUMN_TYPE_MASK) { case GRN_OBJ_COLUMN_VECTOR: - /* TODO: We assume that if |range| is GRN_OBJ_KEY_VAR_SIZE, a vector - is GRN_VECTOR, otherwise GRN_UVECTOR. This is not always - the case, especially by using GRNAPI with C, it's possible - to create GRN_VECTOR with values of constant-size type. */ - if (((struct _grn_type *)grn_ctx_at(ctx, range))->obj.header.flags & - GRN_OBJ_KEY_VAR_SIZE) { - GRN_OBJ_INIT(&buf, GRN_VECTOR, 0, range); - grn_obj_get_value(ctx, column, id, &buf); - grn_text_otoj(ctx, outbuf, &buf, NULL); - grn_obj_unlink(ctx, &buf); - } else { - GRN_OBJ_INIT(&buf, GRN_UVECTOR, 0, range); - grn_obj_get_value(ctx, column, id, &buf); - grn_text_otoj(ctx, outbuf, &buf, NULL); - grn_obj_unlink(ctx, &buf); - } + dump_record_column_vector(ctx, outbuf, id, column, range, &buf); break; case GRN_OBJ_COLUMN_SCALAR: { @@ -2471,11 +2432,6 @@ dump_records(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table) grn_obj_unlink(ctx, &buf); } break; - case GRN_OBJ_COLUMN_INDEX: - if (GRN_OBJ_FORWARD_INDEX_COLUMNP(column)) { - dump_record_column_forward_index(ctx, outbuf, id, column); - } - break; default: ERR(GRN_OPERATION_NOT_SUPPORTED, "unsupported column type: %#x", @@ -2483,6 +2439,8 @@ dump_records(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table) break; } break; + case GRN_COLUMN_INDEX: + break; case GRN_ACCESSOR: { GRN_OBJ_INIT(&buf, GRN_BULK, 0, range); Modified: lib/str.c (+16 -6) =================================================================== --- lib/str.c 2014-03-05 12:24:24 +0900 (d0b6364) +++ lib/str.c 2014-03-05 18:24:55 +0900 (7bc0f24) @@ -2847,31 +2847,41 @@ grn_text_otoj(grn_ctx *ctx, grn_obj *bulk, grn_obj *obj, grn_obj_format *format) case GRN_VECTOR : if (obj->header.domain == GRN_DB_VOID) { ERR(GRN_INVALID_ARGUMENT, "invalid obj->header.domain"); - } - if (format) { - ERR(GRN_FUNCTION_NOT_IMPLEMENTED, - "cannot print GRN_VECTOR using grn_obj_format"); } else { unsigned int i, n; grn_obj value; + grn_obj weight; + grn_bool with_weight; + GRN_VOID_INIT(&value); + GRN_UINT32_INIT(&weight, 0); + with_weight = (format && format->flags & GRN_OBJ_FORMAT_WITH_WEIGHT); n = grn_vector_size(ctx, obj); GRN_TEXT_PUTC(ctx, bulk, '['); for (i = 0; i < n; i++) { const char *_value; - unsigned int weight, length; + unsigned int _weight, length; grn_id domain; if (i) { GRN_TEXT_PUTC(ctx, bulk, ','); } length = grn_vector_get_element(ctx, obj, i, - &_value, &weight, &domain); + &_value, &_weight, &domain); if (domain != GRN_DB_VOID) { grn_obj_reinit(ctx, &value, domain, 0); } else { grn_obj_reinit(ctx, &value, obj->header.domain, 0); } + if (with_weight) { + GRN_TEXT_PUTC(ctx, bulk, '{'); + } grn_bulk_write(ctx, &value, _value, length); grn_text_otoj(ctx, bulk, &value, NULL); + if (with_weight) { + GRN_TEXT_PUTC(ctx, bulk, ':'); + GRN_UINT32_SET(ctx, &weight, _weight); + grn_text_otoj(ctx, bulk, &weight, NULL); + GRN_TEXT_PUTC(ctx, bulk, '}'); + } } GRN_TEXT_PUTC(ctx, bulk, ']'); } Renamed: test/command/suite/dump/record/weight_vector_reference.expected (+1 -1) 91% =================================================================== --- test/command/suite/dump/record/forward_index.expected 2014-03-05 12:24:24 +0900 (af3cb50) +++ test/command/suite/dump/record/weight_vector_reference.expected 2014-03-05 18:24:55 +0900 (3ccee09) @@ -2,7 +2,7 @@ table_create Tags TABLE_PAT_KEY ShortText [[0,0.0,0.0],true] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags [[0,0.0,0.0],true] load --table Memos [ Copied: test/command/suite/dump/record/weight_vector_reference.test (+3 -1) 61% =================================================================== --- test/command/suite/dump/record/forward_index.test 2014-03-05 12:24:24 +0900 (47cd93a) +++ test/command/suite/dump/record/weight_vector_reference.test 2014-03-05 18:24:55 +0900 (03a6c96) @@ -1,7 +1,9 @@ +#@omit "weight vector for reference type will be supported in the future" + table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags load --table Memos [ Added: test/command/suite/dump/record/weight_vector_type.expected (+24 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/dump/record/weight_vector_type.expected 2014-03-05 18:24:55 +0900 (13ea7ad) @@ -0,0 +1,24 @@ +table_create Memos TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT ShortText +[[0,0.0,0.0],true] +load --table Memos +[ +{ + "_key": "Groonga is fast", + "tags": { + "groonga": 100, + "full text serach": 10 + } +} +] +[[0,0.0,0.0],1] +dump +table_create Memos TABLE_HASH_KEY ShortText +column_create Memos tags COLUMN_VECTOR ShortText +load --table Memos +[ +["_key","tags"], +["Groonga is fast",[{"groonga":100},{"full text serach":10}]] +] + Renamed: test/command/suite/dump/record/weight_vector_type.test (+1 -3) 63% =================================================================== --- test/command/suite/dump/record/forward_index.test 2014-03-05 12:24:24 +0900 (47cd93a) +++ test/command/suite/dump/record/weight_vector_type.test 2014-03-05 18:24:55 +0900 (c43228e) @@ -1,7 +1,5 @@ -table_create Tags TABLE_PAT_KEY ShortText - table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT ShortText load --table Memos [ Added: test/command/suite/load/vector/add/weight/array/invalid/normal_vector.expected (+19 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/load/vector/add/weight/array/invalid/normal_vector.expected 2014-03-05 18:24:55 +0900 (cc0b4db) @@ -0,0 +1,19 @@ +table_create Tags TABLE_PAT_KEY ShortText +[[0,0.0,0.0],true] +table_create Memos TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Memos tags COLUMN_VECTOR Tags +[[0,0.0,0.0],true] +load --table Memos +[ +["_key", "tags"], +[ + "Groonga is fast", + { + "groonga": 100 + } +] +] +[[0,0.0,0.0],1] +#|e| <Memos.tags>: columns except weight vector column don't support object value +#|e| [table][load] failed to set column value: <Memos.tags>: columns except weight vector column don't support object value: key: <"Groonga is fast">, column: <Memos.tags>, value: <{"groonga": 100}> Copied: test/command/suite/load/vector/add/weight/array/invalid/normal_vector.test (+1 -3) 72% =================================================================== --- test/command/suite/load/index/forward/array/value_weight.test 2014-03-05 12:24:24 +0900 (04ca5ce) +++ test/command/suite/load/vector/add/weight/array/invalid/normal_vector.test 2014-03-05 18:24:55 +0900 (336819e) @@ -1,7 +1,7 @@ table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR Tags load --table Memos [ @@ -13,5 +13,3 @@ load --table Memos } ] ] - -select Tags Renamed: test/command/suite/load/vector/add/weight/array/invalid/scalar.expected (+2 -2) 57% =================================================================== --- test/command/suite/load/index/forward/array/invalid/not_index_column.expected 2014-03-05 12:24:24 +0900 (b132880) +++ test/command/suite/load/vector/add/weight/array/invalid/scalar.expected 2014-03-05 18:24:55 +0900 (f5e55f1) @@ -13,5 +13,5 @@ load --table Memos ] ] [[0,0.0,0.0],1] -#|e| <Memos.content>: columns except index column don't support object value -#|e| [table][load] failed to set column value: <Memos.content>: columns except index column don't support object value: key: <"Groonga is fast">, column: <Memos.content>, value: <{"groonga": 100}> +#|e| <Memos.content>: columns except weight vector column don't support object value +#|e| [table][load] failed to set column value: <Memos.content>: columns except weight vector column don't support object value: key: <"Groonga is fast">, column: <Memos.content>, value: <{"groonga": 100}> Renamed: test/command/suite/load/vector/add/weight/array/invalid/scalar.test (+0 -0) 100% =================================================================== Renamed: test/command/suite/load/vector/add/weight/array/value_weight.expected (+1 -1) 85% =================================================================== --- test/command/suite/load/index/forward/array/value_weight.expected 2014-03-05 12:24:24 +0900 (efb398a) +++ test/command/suite/load/vector/add/weight/array/value_weight.expected 2014-03-05 18:24:55 +0900 (508cd10) @@ -2,7 +2,7 @@ table_create Tags TABLE_PAT_KEY ShortText [[0,0.0,0.0],true] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags [[0,0.0,0.0],true] load --table Memos [ Renamed: test/command/suite/load/vector/add/weight/array/value_weight.test (+1 -1) 77% =================================================================== --- test/command/suite/load/index/forward/array/value_weight.test 2014-03-05 12:24:24 +0900 (04ca5ce) +++ test/command/suite/load/vector/add/weight/array/value_weight.test 2014-03-05 18:24:55 +0900 (498cc7d) @@ -1,7 +1,7 @@ table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags load --table Memos [ Added: test/command/suite/load/vector/add/weight/object/invalid/normal_vector.expected (+18 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/load/vector/add/weight/object/invalid/normal_vector.expected 2014-03-05 18:24:55 +0900 (d8c123e) @@ -0,0 +1,18 @@ +table_create Tags TABLE_PAT_KEY ShortText +[[0,0.0,0.0],true] +table_create Memos TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Memos tags COLUMN_VECTOR Tags +[[0,0.0,0.0],true] +load --table Memos +[ +{ + "_key": "Groonga is fast", + "tags": { + "groonga": 100 + } +} +] +[[0,0.0,0.0],1] +#|e| <Memos.tags>: columns except weight vector column don't support object value +#|e| [table][load] failed to set column value: <Memos.tags>: columns except weight vector column don't support object value: key: <"Groonga is fast">, column: <tags>, value: <{"groonga": 100}> Copied: test/command/suite/load/vector/add/weight/object/invalid/normal_vector.test (+1 -3) 72% =================================================================== --- test/command/suite/load/index/forward/object/value_weight.test 2014-03-05 12:24:24 +0900 (d11dcb9) +++ test/command/suite/load/vector/add/weight/object/invalid/normal_vector.test 2014-03-05 18:24:55 +0900 (442cfb6) @@ -1,7 +1,7 @@ table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR Tags load --table Memos [ @@ -12,5 +12,3 @@ load --table Memos } } ] - -select Tags Renamed: test/command/suite/load/vector/add/weight/object/invalid/scalar.expected (+2 -2) 58% =================================================================== --- test/command/suite/load/index/forward/object/invalid/not_index_column.expected 2014-03-05 12:24:24 +0900 (71f2c34) +++ test/command/suite/load/vector/add/weight/object/invalid/scalar.expected 2014-03-05 18:24:55 +0900 (9753944) @@ -12,5 +12,5 @@ load --table Memos } ] [[0,0.0,0.0],1] -#|e| <Memos.content>: columns except index column don't support object value -#|e| [table][load] failed to set column value: <Memos.content>: columns except index column don't support object value: key: <"Groonga is fast">, column: <content>, value: <{"groonga": 100}> +#|e| <Memos.content>: columns except weight vector column don't support object value +#|e| [table][load] failed to set column value: <Memos.content>: columns except weight vector column don't support object value: key: <"Groonga is fast">, column: <content>, value: <{"groonga": 100}> Renamed: test/command/suite/load/vector/add/weight/object/invalid/scalar.test (+0 -0) 100% =================================================================== Renamed: test/command/suite/load/vector/add/weight/object/value_weight.expected (+1 -1) 85% =================================================================== --- test/command/suite/load/index/forward/object/value_weight.expected 2014-03-05 12:24:24 +0900 (441cb57) +++ test/command/suite/load/vector/add/weight/object/value_weight.expected 2014-03-05 18:24:55 +0900 (15018bd) @@ -2,7 +2,7 @@ table_create Tags TABLE_PAT_KEY ShortText [[0,0.0,0.0],true] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags [[0,0.0,0.0],true] load --table Memos [ Renamed: test/command/suite/load/vector/add/weight/object/value_weight.test (+1 -1) 77% =================================================================== --- test/command/suite/load/index/forward/object/value_weight.test 2014-03-05 12:24:24 +0900 (d11dcb9) +++ test/command/suite/load/vector/add/weight/object/value_weight.test 2014-03-05 18:24:55 +0900 (6378c96) @@ -1,7 +1,7 @@ table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags load --table Memos [ Modified: test/command/suite/select/adjuster/multiple.expected (+1 -1) =================================================================== --- test/command/suite/select/adjuster/multiple.expected 2014-03-05 12:24:24 +0900 (0f8ce4c) +++ test/command/suite/select/adjuster/multiple.expected 2014-03-05 18:24:55 +0900 (0123faa) @@ -2,7 +2,7 @@ table_create Tags TABLE_PAT_KEY ShortText [[0,0.0,0.0],true] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags [[0,0.0,0.0],true] column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags [[0,0.0,0.0],true] Modified: test/command/suite/select/adjuster/multiple.test (+1 -1) =================================================================== --- test/command/suite/select/adjuster/multiple.test 2014-03-05 12:24:24 +0900 (41c1456) +++ test/command/suite/select/adjuster/multiple.test 2014-03-05 18:24:55 +0900 (fedb265) @@ -1,7 +1,7 @@ table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags Modified: test/command/suite/select/adjuster/no_factor.expected (+1 -1) =================================================================== --- test/command/suite/select/adjuster/no_factor.expected 2014-03-05 12:24:24 +0900 (afe57c5) +++ test/command/suite/select/adjuster/no_factor.expected 2014-03-05 18:24:55 +0900 (17780a7) @@ -2,7 +2,7 @@ table_create Tags TABLE_PAT_KEY ShortText [[0,0.0,0.0],true] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags [[0,0.0,0.0],true] column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags [[0,0.0,0.0],true] Modified: test/command/suite/select/adjuster/no_factor.test (+1 -1) =================================================================== --- test/command/suite/select/adjuster/no_factor.test 2014-03-05 12:24:24 +0900 (20004c9) +++ test/command/suite/select/adjuster/no_factor.test 2014-03-05 18:24:55 +0900 (af68293) @@ -1,7 +1,7 @@ table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags Modified: test/command/suite/select/adjuster/not_all_match.expected (+1 -1) =================================================================== --- test/command/suite/select/adjuster/not_all_match.expected 2014-03-05 12:24:24 +0900 (d2862a4) +++ test/command/suite/select/adjuster/not_all_match.expected 2014-03-05 18:24:55 +0900 (5b098eb) @@ -2,7 +2,7 @@ table_create Tags TABLE_PAT_KEY ShortText [[0,0.0,0.0],true] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags [[0,0.0,0.0],true] column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags [[0,0.0,0.0],true] Modified: test/command/suite/select/adjuster/not_all_match.test (+1 -1) =================================================================== --- test/command/suite/select/adjuster/not_all_match.test 2014-03-05 12:24:24 +0900 (29730bb) +++ test/command/suite/select/adjuster/not_all_match.test 2014-03-05 18:24:55 +0900 (0a2b6c7) @@ -1,7 +1,7 @@ table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags Renamed: test/command/suite/select/adjuster/not_weight_vector.expected (+0 -0) 100% =================================================================== Renamed: test/command/suite/select/adjuster/not_weight_vector.test (+0 -0) 100% =================================================================== Modified: test/command/suite/select/adjuster/one.expected (+1 -1) =================================================================== --- test/command/suite/select/adjuster/one.expected 2014-03-05 12:24:24 +0900 (fcb0f17) +++ test/command/suite/select/adjuster/one.expected 2014-03-05 18:24:55 +0900 (6da3ab3) @@ -2,7 +2,7 @@ table_create Tags TABLE_PAT_KEY ShortText [[0,0.0,0.0],true] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags [[0,0.0,0.0],true] column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags [[0,0.0,0.0],true] Modified: test/command/suite/select/adjuster/one.test (+1 -1) =================================================================== --- test/command/suite/select/adjuster/one.test 2014-03-05 12:24:24 +0900 (5cc0949) +++ test/command/suite/select/adjuster/one.test 2014-03-05 18:24:55 +0900 (12e561c) @@ -1,7 +1,7 @@ table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags Renamed: test/command/suite/select/match_columns/weight/nested_weight_vector.expected (+1 -1) 96% =================================================================== --- test/command/suite/select/match_columns/weight/nested_forward_index.expected 2014-03-05 12:24:24 +0900 (9d88186) +++ test/command/suite/select/match_columns/weight/nested_weight_vector.expected 2014-03-05 18:24:55 +0900 (96bea98) @@ -2,7 +2,7 @@ table_create Tags TABLE_PAT_KEY ShortText [[0,0.0,0.0],true] table_create Products TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Products tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Products tags COLUMN_VECTOR|WITH_WEIGHT Tags [[0,0.0,0.0],true] column_create Tags products_tags COLUMN_INDEX|WITH_WEIGHT Products tags [[0,0.0,0.0],true] Renamed: test/command/suite/select/match_columns/weight/nested_weight_vector.test (+1 -1) 94% =================================================================== --- test/command/suite/select/match_columns/weight/nested_forward_index.test 2014-03-05 12:24:24 +0900 (66ffd0e) +++ test/command/suite/select/match_columns/weight/nested_weight_vector.test 2014-03-05 18:24:55 +0900 (a92acd4) @@ -1,7 +1,7 @@ table_create Tags TABLE_PAT_KEY ShortText table_create Products TABLE_HASH_KEY ShortText -column_create Products tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Products tags COLUMN_VECTOR|WITH_WEIGHT Tags column_create Tags products_tags COLUMN_INDEX|WITH_WEIGHT Products tags Renamed: test/command/suite/select/match_columns/weight/weight_vector.expected (+1 -1) 94% =================================================================== --- test/command/suite/select/match_columns/weight/forward_index.expected 2014-03-05 12:24:24 +0900 (062b92a) +++ test/command/suite/select/match_columns/weight/weight_vector.expected 2014-03-05 18:24:55 +0900 (6478059) @@ -2,7 +2,7 @@ table_create Tags TABLE_PAT_KEY ShortText [[0,0.0,0.0],true] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags [[0,0.0,0.0],true] column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags [[0,0.0,0.0],true] Renamed: test/command/suite/select/match_columns/weight/weight_vector.test (+1 -1) 90% =================================================================== --- test/command/suite/select/match_columns/weight/forward_index.test 2014-03-05 12:24:24 +0900 (610ce70) +++ test/command/suite/select/match_columns/weight/weight_vector.test 2014-03-05 18:24:55 +0900 (518470f) @@ -1,7 +1,7 @@ table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags Copied: test/command/suite/select/output/value/weight_vector/reference.expected (+1 -1) 91% =================================================================== --- test/command/suite/select/output/value/forward_index.expected 2014-03-05 12:24:24 +0900 (eff7f67) +++ test/command/suite/select/output/value/weight_vector/reference.expected 2014-03-05 18:24:55 +0900 (91539b1) @@ -2,7 +2,7 @@ table_create Tags TABLE_PAT_KEY ShortText [[0,0.0,0.0],true] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags [[0,0.0,0.0],true] load --table Memos [ Copied: test/command/suite/select/output/value/weight_vector/reference.test (+3 -1) 64% =================================================================== --- test/command/suite/select/output/value/forward_index.test 2014-03-05 12:24:24 +0900 (950be2e) +++ test/command/suite/select/output/value/weight_vector/reference.test 2014-03-05 18:24:55 +0900 (06afbd6) @@ -1,7 +1,9 @@ +#@omit "weight vector for reference type will be supported in the future" + table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags load --table Memos [ Renamed: test/command/suite/select/output/value/weight_vector/type.expected (+2 -4) 80% =================================================================== --- test/command/suite/select/output/value/forward_index.expected 2014-03-05 12:24:24 +0900 (eff7f67) +++ test/command/suite/select/output/value/weight_vector/type.expected 2014-03-05 18:24:55 +0900 (aafab33) @@ -1,8 +1,6 @@ -table_create Tags TABLE_PAT_KEY ShortText -[[0,0.0,0.0],true] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT ShortText [[0,0.0,0.0],true] load --table Memos [ @@ -34,7 +32,7 @@ select Memos --output_columns _key,tags ], [ "tags", - "Tags" + "ShortText" ] ], [ Renamed: test/command/suite/select/output/value/weight_vector/type.test (+1 -3) 67% =================================================================== --- test/command/suite/select/output/value/forward_index.test 2014-03-05 12:24:24 +0900 (950be2e) +++ test/command/suite/select/output/value/weight_vector/type.test 2014-03-05 18:24:55 +0900 (28f1fab) @@ -1,7 +1,5 @@ -table_create Tags TABLE_PAT_KEY ShortText - table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT ShortText load --table Memos [ Renamed: test/command/suite/select/query/weight_vector.expected (+1 -1) 94% =================================================================== --- test/command/suite/select/query/forward_index.expected 2014-03-05 12:24:24 +0900 (5e79fc4) +++ test/command/suite/select/query/weight_vector.expected 2014-03-05 18:24:55 +0900 (ed7a2c6) @@ -2,7 +2,7 @@ table_create Tags TABLE_PAT_KEY ShortText [[0,0.0,0.0],true] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags [[0,0.0,0.0],true] column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags [[0,0.0,0.0],true] Renamed: test/command/suite/select/query/weight_vector.test (+1 -1) 90% =================================================================== --- test/command/suite/select/query/forward_index.test 2014-03-05 12:24:24 +0900 (9f2aa9f) +++ test/command/suite/select/query/weight_vector.test 2014-03-05 18:24:55 +0900 (a95e9b6) @@ -1,7 +1,7 @@ table_create Tags TABLE_PAT_KEY ShortText table_create Memos TABLE_HASH_KEY ShortText -column_create Memos tags COLUMN_INDEX|WITH_WEIGHT Tags +column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags -------------- next part -------------- HTML����������������������������... Download