Kouhei Sutou
null+****@clear*****
Wed May 2 13:06:39 JST 2018
Kouhei Sutou 2018-05-02 13:06:39 +0900 (Wed, 02 May 2018) New Revision: 7020bf4253f2ca367cfa0055627725fd0d97c629 https://github.com/groonga/groonga/commit/7020bf4253f2ca367cfa0055627725fd0d97c629 Message: test: add more tests for offline index construction with normalizer options Added files: test/command/suite/table_create/normalizer/nfkc100/options/offline/text_vector.expected test/command/suite/table_create/normalizer/nfkc100/options/offline/text_vector.test Renamed files: test/command/suite/table_create/normalizer/nfkc100/options/offline/text_scalar.expected (from test/command/suite/table_create/normalizer/nfkc100/options/offline.expected) test/command/suite/table_create/normalizer/nfkc100/options/offline/text_scalar.test (from test/command/suite/table_create/normalizer/nfkc100/options/offline.test) Renamed: test/command/suite/table_create/normalizer/nfkc100/options/offline/text_scalar.expected (+34 -1) 53% =================================================================== --- test/command/suite/table_create/normalizer/nfkc100/options/offline.expected 2018-05-02 13:04:44 +0900 (2a2432f1f) +++ test/command/suite/table_create/normalizer/nfkc100/options/offline/text_scalar.expected 2018-05-02 13:06:39 +0900 (87ff44985) @@ -10,7 +10,40 @@ load --table Memos [[0,0.0,0.0],2] table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer 'NormalizerNFKC100("unify_kana", true)' [[0,0.0,0.0],true] -column_create Terms memos_content COLUMN_INDEX Memos content +column_create Terms memos_content COLUMN_INDEX|WITH_POSITION Memos content [[0,0.0,0.0],true] select Terms --output_columns _key --limit -1 [[0,0.0,0.0],[[[3],[["_key","ShortText"]],["ご"],["りん"],["んご"]]]] +select Memos --match_columns content --query りんご +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "content", + "Text" + ] + ], + [ + 1, + "リンゴ" + ], + [ + 2, + "りんご" + ] + ] + ] +] Renamed: test/command/suite/table_create/normalizer/nfkc100/options/offline/text_scalar.test (+3 -1) 72% =================================================================== --- test/command/suite/table_create/normalizer/nfkc100/options/offline.test 2018-05-02 13:04:44 +0900 (b0b18557e) +++ test/command/suite/table_create/normalizer/nfkc100/options/offline/text_scalar.test 2018-05-02 13:06:39 +0900 (174cbaa0b) @@ -10,6 +10,8 @@ load --table Memos table_create Terms TABLE_PAT_KEY ShortText \ --default_tokenizer TokenBigram \ --normalizer 'NormalizerNFKC100("unify_kana", true)' -column_create Terms memos_content COLUMN_INDEX Memos content +column_create Terms memos_content COLUMN_INDEX|WITH_POSITION Memos content select Terms --output_columns _key --limit -1 + +select Memos --match_columns content --query りんご Added: test/command/suite/table_create/normalizer/nfkc100/options/offline/text_vector.expected (+92 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_create/normalizer/nfkc100/options/offline/text_vector.expected 2018-05-02 13:06:39 +0900 (5f04567d7) @@ -0,0 +1,92 @@ +table_create Memos TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Memos contents COLUMN_VECTOR Text +[[0,0.0,0.0],true] +load --table Memos +[ +{"contents": ["リンゴ", "バナナ"]}, +{"contents": ["りんご", "ばなな"]} +] +[[0,0.0,0.0],2] +table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer 'NormalizerNFKC100("unify_kana", true)' +[[0,0.0,0.0],true] +column_create Terms memos_content COLUMN_INDEX|WITH_POSITION|WITH_SECTION Memos contents +[[0,0.0,0.0],true] +select Terms --output_columns _key --limit -1 +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 6 + ], + [ + [ + "_key", + "ShortText" + ] + ], + [ + "ご" + ], + [ + "な" + ], + [ + "なな" + ], + [ + "ばな" + ], + [ + "りん" + ], + [ + "んご" + ] + ] + ] +] +select Memos --match_columns contents --query ばなな +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "contents", + "Text" + ] + ], + [ + 1, + [ + "リンゴ", + "バナナ" + ] + ], + [ + 2, + [ + "りんご", + "ばなな" + ] + ] + ] + ] +] Added: test/command/suite/table_create/normalizer/nfkc100/options/offline/text_vector.test (+18 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/table_create/normalizer/nfkc100/options/offline/text_vector.test 2018-05-02 13:06:39 +0900 (0a1ce5fdb) @@ -0,0 +1,18 @@ +table_create Memos TABLE_NO_KEY +column_create Memos contents COLUMN_VECTOR Text + +load --table Memos +[ +{"contents": ["リンゴ", "バナナ"]}, +{"contents": ["りんご", "ばなな"]} +] + +table_create Terms TABLE_PAT_KEY ShortText \ + --default_tokenizer TokenBigram \ + --normalizer 'NormalizerNFKC100("unify_kana", true)' +column_create Terms memos_content COLUMN_INDEX|WITH_POSITION|WITH_SECTION \ + Memos contents + +select Terms --output_columns _key --limit -1 + +select Memos --match_columns contents --query ばなな -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180502/418eb7ab/attachment-0001.htm