Debian Codegraph @

test/command/suite/select/index/nested/by_column/double_array_trie.test

raw
1 table_create Comments TABLE_DAT_KEY ShortText
2 column_create Comments content COLUMN_SCALAR ShortText
3
4 table_create Articles TABLE_DAT_KEY ShortText
5 column_create Articles content COLUMN_SCALAR Text
6 column_create Articles comment COLUMN_SCALAR Comments
7
8 table_create Lexicon TABLE_PAT_KEY|KEY_NORMALIZE ShortText \
9 --default_tokenizer TokenBigram
10 column_create Lexicon articles_content COLUMN_INDEX|WITH_POSITION \
11 Articles content
12 column_create Lexicon comments_content COLUMN_INDEX|WITH_POSITION \
13 Comments content
14
15 column_create Comments article COLUMN_INDEX Articles comment
16
17 load --table Comments
18 [
19 {"_key": "1-1", "content": "I'm using groonga too!"},
20 {"_key": "2-1", "content": "I'm using groonga and mroonga!"},
21 {"_key": "3-1", "content": "I'm using mroonga too!"},
22 {"_key": "4-1", "content": "I'm using groonga and rroonga too!"}
23 ]
24
25 load --table Articles
26 [
27 ["_key", "content", "comment"],
28 ["groonga-is-fast", "Groonga is fast!", "1-1"],
29 ["groonga-is-useful", "Groonga is useful!", "2-1"],
30 ["mroonga-is-fast", "Mroonga is fast!", "3-1"],
31 ["rroonga-is-fast", "Rroonga is fast!", "4-1"]
32 ]
33
34 select Articles --match_columns comment.content --query groonga \
35 --output_columns "_id, _score, *"