Kouhei Sutou
null+****@clear*****
Sun May 17 12:10:27 JST 2015
Kouhei Sutou 2015-05-17 12:10:27 +0900 (Sun, 17 May 2015) New Revision: fcb97b72512a452a3a4db449dfd69b4bd7a548ab https://github.com/mroonga/mroonga/commit/fcb97b72512a452a3a4db449dfd69b4bd7a548ab Message: Support FT_FLAG and unmatched full text search in output columns Modified files: ha_mroonga.cpp Renamed files: mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/r/have_where_matched_order.result (from mysql-test/mroonga/wrapper/fulltext/multiple_indexes/r/one_where_one_order.result) mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/r/have_where_no_order.result (from mysql-test/mroonga/wrapper/fulltext/multiple_indexes/r/one_where_no_order.result) mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/r/no_where_both_order.result (from mysql-test/mroonga/wrapper/fulltext/multiple_indexes/r/no_where_two_orders.result) mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/t/have_where_matched_order.test (from mysql-test/mroonga/wrapper/fulltext/multiple_indexes/t/one_where_one_order.test) mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/t/have_where_no_order.test (from mysql-test/mroonga/wrapper/fulltext/multiple_indexes/t/one_where_no_order.test) mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/t/no_where_both_order.test (from mysql-test/mroonga/wrapper/fulltext/multiple_indexes/t/no_where_two_orders.test) Modified: ha_mroonga.cpp (+4 -2) =================================================================== --- ha_mroonga.cpp 2015-05-17 00:11:03 +0900 (7a27452) +++ ha_mroonga.cpp 2015-05-17 12:10:27 +0900 (be5ea8f) @@ -8290,12 +8290,11 @@ FT_INFO *ha_mroonga::generic_ft_init_ext(uint flags, uint key_nr, String *key) check_count_skip(0, 0, true); mrn_change_encoding(ctx, system_charset_info); - grn_operator operation = GRN_OP_AND; + grn_operator operation = GRN_OP_OR; if (!matched_record_keys) { matched_record_keys = grn_table_create(ctx, NULL, 0, NULL, GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC, grn_table, 0); - operation = GRN_OP_OR; } grn_table_sort_key *sort_keys = NULL; @@ -8332,6 +8331,9 @@ FT_INFO *ha_mroonga::generic_ft_init_ext(uint flags, uint key_nr, String *key) strlen(MRN_COLUMN_NAME_SCORE)); score_sort_key.offset = 0; score_sort_key.flags = GRN_TABLE_SORT_DESC; + if (sorted_result) { + grn_obj_unlink(ctx, sorted_result); + } sorted_result = grn_table_create(ctx, NULL, 0, NULL, GRN_OBJ_TABLE_NO_KEY, NULL, Renamed: mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/r/have_where_matched_order.result (+0 -0) 100% =================================================================== Renamed: mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/r/have_where_no_order.result (+1 -1) 100% =================================================================== @@ -19,6 +19,6 @@ FROM texts WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE); id matched not_matched MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE) MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE) 1 Hello1 World1 1 0 -2 Hello2 World2 1 0 3 Hello3 World3 1 0 +2 Hello2 World2 1 0 DROP TABLE texts; Renamed: mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/r/no_where_both_order.result (+0 -0) 100% =================================================================== Renamed: mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/t/have_where_matched_order.test (+0 -0) 100% =================================================================== Renamed: mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/t/have_where_no_order.test (+0 -0) 100% =================================================================== Renamed: mysql-test/mroonga/wrapper/fulltext/matched_and_not_matched/t/no_where_both_order.test (+0 -0) 100% =================================================================== -------------- next part -------------- HTML����������������������������...Download