| 1 |
table_create Comments TABLE_HASH_KEY ShortText |
| 2 |
[[0,0.0,0.0],true] |
| 3 |
column_create Comments content COLUMN_SCALAR ShortText |
| 4 |
[[0,0.0,0.0],true] |
| 5 |
table_create Articles TABLE_HASH_KEY ShortText |
| 6 |
[[0,0.0,0.0],true] |
| 7 |
column_create Articles content COLUMN_SCALAR Text |
| 8 |
[[0,0.0,0.0],true] |
| 9 |
column_create Articles comment COLUMN_SCALAR Comments |
| 10 |
[[0,0.0,0.0],true] |
| 11 |
table_create Lexicon TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenBigram |
| 12 |
[[0,0.0,0.0],true] |
| 13 |
column_create Lexicon articles_content COLUMN_INDEX|WITH_POSITION Articles content |
| 14 |
[[0,0.0,0.0],true] |
| 15 |
column_create Lexicon comments_content COLUMN_INDEX|WITH_POSITION Comments content |
| 16 |
[[0,0.0,0.0],true] |
| 17 |
column_create Comments article COLUMN_INDEX Articles comment |
| 18 |
[[0,0.0,0.0],true] |
| 19 |
load --table Comments |
| 20 |
[ |
| 21 |
{"_key": "1-1", "content": "I'm using groonga too!"}, |
| 22 |
{"_key": "2-1", "content": "I'm using groonga and mroonga!"}, |
| 23 |
{"_key": "3-1", "content": "I'm using mroonga too!"}, |
| 24 |
{"_key": "4-1", "content": "I'm using groonga and rroonga too!"} |
| 25 |
] |
| 26 |
[[0,0.0,0.0],4] |
| 27 |
load --table Articles |
| 28 |
[ |
| 29 |
["_key", "content", "comment"], |
| 30 |
["groonga-is-fast", "Groonga is fast!", "1-1"], |
| 31 |
["groonga-is-useful", "Groonga is useful!", "2-1"], |
| 32 |
["mroonga-is-fast", "Mroonga is fast!", "3-1"], |
| 33 |
["rroonga-is-fast", "Rroonga is fast!", "4-1"] |
| 34 |
] |
| 35 |
[[0,0.0,0.0],4] |
| 36 |
select Articles --match_columns comment.content --query groonga --output_columns "_id, _score, *" |
| 37 |
[ |
| 38 |
[ |
| 39 |
0, |
| 40 |
0.0, |
| 41 |
0.0 |
| 42 |
], |
| 43 |
[ |
| 44 |
[ |
| 45 |
[ |
| 46 |
3 |
| 47 |
], |
| 48 |
[ |
| 49 |
[ |
| 50 |
"_id", |
| 51 |
"UInt32" |
| 52 |
], |
| 53 |
[ |
| 54 |
"_score", |
| 55 |
"Int32" |
| 56 |
], |
| 57 |
[ |
| 58 |
"comment", |
| 59 |
"Comments" |
| 60 |
], |
| 61 |
[ |
| 62 |
"content", |
| 63 |
"Text" |
| 64 |
] |
| 65 |
], |
| 66 |
[ |
| 67 |
1, |
| 68 |
1, |
| 69 |
"1-1", |
| 70 |
"Groonga is fast!" |
| 71 |
], |
| 72 |
[ |
| 73 |
2, |
| 74 |
1, |
| 75 |
"2-1", |
| 76 |
"Groonga is useful!" |
| 77 |
], |
| 78 |
[ |
| 79 |
4, |
| 80 |
1, |
| 81 |
"4-1", |
| 82 |
"Rroonga is fast!" |
| 83 |
] |
| 84 |
] |
| 85 |
] |
| 86 |
] |