Naoya Murakami
null+****@clear*****
Sun Aug 21 07:19:56 JST 2016
Naoya Murakami 2016-08-21 07:19:56 +0900 (Sun, 21 Aug 2016) New Revision: 9d264be0822c5d3c75a6bde4d3a582279d52755b https://github.com/groonga/groonga/commit/9d264be0822c5d3c75a6bde4d3a582279d52755b Merged 5478adc: Merge pull request #591 from naoa/resolve-rid-ii-sequential Message: ii: resolve record id on grn_ii_select_sequential_search Added files: test/command/suite/select/query/sequential_search/ii/short_text.expected test/command/suite/select/query/sequential_search/ii/short_text.test Modified files: lib/ii.c Modified: lib/ii.c (+3 -1) =================================================================== --- lib/ii.c 2016-08-19 16:04:16 +0900 (2e66493) +++ lib/ii.c 2016-08-21 07:19:56 +0900 (9dee00c) @@ -7602,6 +7602,8 @@ grn_ii_select_sequential_search_body(grn_ctx *ctx, grn_obj *value; const char *normalized_value; unsigned int normalized_value_length; + grn_id *rid; + grn_hash_cursor_get_key(ctx, cursor, (void **)&rid); GRN_BULK_REWIND(&buffer); grn_obj_get_value(ctx, accessor, id, &buffer); @@ -7622,7 +7624,7 @@ grn_ii_select_sequential_search_body(grn_ctx *ctx, if (position != ONIG_MISMATCH) { grn_rset_posinfo info; double score; - info.rid = id; + info.rid = *rid; info.sid = i + 1; info.pos = 0; score = get_weight(ctx, result, info.rid, info.sid, wvm, optarg); Added: test/command/suite/select/query/sequential_search/ii/short_text.expected (+56 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/sequential_search/ii/short_text.expected 2016-08-21 07:19:56 +0900 (bfd9eb2) @@ -0,0 +1,56 @@ +table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram +[[0,0.0,0.0],true] +table_create Memos TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Memos body COLUMN_SCALAR ShortText +[[0,0.0,0.0],true] +load --table Memos +[ +{"body": "Rroonga is fast!"}, +{"body": "Groonga is fast!"}, +{"body": "Mroonga is fast!"}, +{"body": "Groonga sticker!"}, +{"body": "Groonga is good!"} +] +[[0,0.0,0.0],5] +column_create Terms memos_body COLUMN_INDEX Memos body +[[0,0.0,0.0],true] +select Memos --query '_id:>=3 body:@"Groonga"' --output_columns _id,_score,body +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "_score", + "Int32" + ], + [ + "body", + "ShortText" + ] + ], + [ + 4, + 2, + "Groonga sticker!" + ], + [ + 5, + 2, + "Groonga is good!" + ] + ] + ] +] Added: test/command/suite/select/query/sequential_search/ii/short_text.test (+19 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query/sequential_search/ii/short_text.test 2016-08-21 07:19:56 +0900 (dadb298) @@ -0,0 +1,19 @@ +#$GRN_II_SELECT_TOO_MANY_INDEX_MATCH_RATIO=0.7 + +table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram + +table_create Memos TABLE_NO_KEY +column_create Memos body COLUMN_SCALAR ShortText + +load --table Memos +[ +{"body": "Rroonga is fast!"}, +{"body": "Groonga is fast!"}, +{"body": "Mroonga is fast!"}, +{"body": "Groonga sticker!"}, +{"body": "Groonga is good!"} +] + +column_create Terms memos_body COLUMN_INDEX Memos body + +select Memos --query '_id:>=3 body:@"Groonga"' --output_columns _id,_score,body -------------- next part -------------- HTML����������������������������... Download