Debian Codegraph @

test/command/suite/select/slices/query_expander.test

raw
1 table_create Memos TABLE_HASH_KEY ShortText
2
3 table_create Terms TABLE_PAT_KEY ShortText \
4 --default_tokenizer TokenBigram \
5 --normalizer NormalizerAuto
6 column_create Terms memos_key COLUMN_INDEX|WITH_POSITION Memos _key
7
8 table_create Synonyms TABLE_PAT_KEY ShortText --normalizer NormalizerAuto
9 column_create Synonyms words COLUMN_VECTOR ShortText
10
11 load --table Memos
12 [
13 {"_key": "Groonga is fast!"},
14 {"_key": "Mroonga is fast!"},
15 {"_key": "Groonga sticker!"},
16 {"_key": "Rroonga is fast!"},
17 {"_key": "Ruby is good!"},
18 {"_key": "Ruby and Groonga combination is good!"}
19 ]
20
21 load --table Synonyms
22 [
23 ["_key", "words"],
24 ["Rroonga", ["Rroonga", "Ruby Groonga"]]
25 ]
26
27 select Memos \
28 --slices[rroonga].match_columns '_key' \
29 --slices[rroonga].query 'Rroonga' \
30 --slices[rroonga].query_expander Synonyms.words