Kouhei Sutou
null+****@clear*****
Fri Feb 13 22:21:32 JST 2015
Kouhei Sutou 2015-02-13 22:21:32 +0900 (Fri, 13 Feb 2015) New Revision: e5d494391f6d8c34bc14fdd77cd913c78a285d0b https://github.com/groonga/groonga/commit/e5d494391f6d8c34bc14fdd77cd913c78a285d0b Message: all_records: use double for score Modified files: lib/proc.c test/command/suite/select/query_flags/allow_leading_not.expected test/command/suite/select/query_flags/allow_leading_not.test Modified: lib/proc.c (+4 -9) =================================================================== --- lib/proc.c 2015-02-13 21:30:45 +0900 (b72b2e2) +++ lib/proc.c 2015-02-13 22:21:32 +0900 (8ebdfd4) @@ -4580,19 +4580,14 @@ selector_all_records(grn_ctx *ctx, grn_obj *table, grn_obj *index, int nargs, grn_obj **args, grn_obj *res, grn_operator op) { - grn_obj score; - - GRN_UINT32_INIT(&score, 0); - GRN_UINT32_SET(ctx, &score, 1); + grn_ii_posting posting; + memset(&posting, 0, sizeof(grn_ii_posting)); GRN_TABLE_EACH(ctx, table, 0, 0, id, NULL, NULL, NULL, { - grn_id result_id; - result_id = grn_table_add(ctx, res, &id, sizeof(grn_id), NULL); - grn_obj_set_value(ctx, res, result_id, &score, GRN_OBJ_SET); + posting.rid = id; + grn_ii_posting_add(ctx, &posting, (grn_hash *)res, GRN_OP_OR); }); - GRN_OBJ_FIN(ctx, &score); - return ctx->rc; } Modified: test/command/suite/select/query_flags/allow_leading_not.expected (+11 -11) =================================================================== --- test/command/suite/select/query_flags/allow_leading_not.expected 2015-02-13 21:30:45 +0900 (6a2643a) +++ test/command/suite/select/query_flags/allow_leading_not.expected 2015-02-13 22:21:32 +0900 (cfaab1a) @@ -20,7 +20,7 @@ load --table Entries "content": "I also migrated all Tritonn system!"} ] [[0,0.0,0.0],5] -select Entries --match_columns content --query '-fast' --query_flags ALLOW_LEADING_NOT +select Entries --output_columns '_key,content,_score' --match_columns content --query '-fast' --query_flags ALLOW_LEADING_NOT [ [ 0, @@ -34,32 +34,32 @@ select Entries --match_columns content --query '-fast' --query_flags ALLOW_LEA ], [ [ - "_id", - "UInt32" - ], - [ "_key", "ShortText" ], [ "content", "Text" + ], + [ + "_score", + "Int32" ] ], [ - 4, "Good-bye Senna", - "I migrated all Senna system!" + "I migrated all Senna system!", + 1 ], [ - 5, "Good-bye Tritonn", - "I also migrated all Tritonn system!" + "I also migrated all Tritonn system!", + 1 ], [ - 1, "The first post!", - "Welcome! This is my first post!" + "Welcome! This is my first post!", + 1 ] ] ] Modified: test/command/suite/select/query_flags/allow_leading_not.test (+3 -1) =================================================================== --- test/command/suite/select/query_flags/allow_leading_not.test 2015-02-13 21:30:45 +0900 (31e7886) +++ test/command/suite/select/query_flags/allow_leading_not.test 2015-02-13 22:21:32 +0900 (cfd49ef) @@ -18,5 +18,7 @@ load --table Entries "content": "I also migrated all Tritonn system!"} ] -select Entries --match_columns content --query '-fast' \ +select Entries \ + --output_columns '_key,content,_score' \ + --match_columns content --query '-fast' \ --query_flags ALLOW_LEADING_NOT -------------- next part -------------- HTML����������������������������... Download