| 1 |
table_create Comments TABLE_HASH_KEY UInt32 |
| 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_NO_KEY |
| 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, "content": "I'm using groonga too!"}, |
| 22 |
{"_key": 2, "content": "I'm using groonga and mroonga!"}, |
| 23 |
{"_key": 3, "content": "I'm using mroonga too!"} |
| 24 |
] |
| 25 |
[[0,0.0,0.0],3] |
| 26 |
load --table Articles |
| 27 |
[ |
| 28 |
{"content": "Groonga is fast!", "comment": 1}, |
| 29 |
{"content": "Groonga is useful!"}, |
| 30 |
{"content": "Mroonga is fast!", "comment": 3} |
| 31 |
] |
| 32 |
[[0,0.0,0.0],3] |
| 33 |
select Articles --match_columns 'comment.content * 10' --query groonga --output_columns "_id, _score, *" |
| 34 |
[ |
| 35 |
[ |
| 36 |
0, |
| 37 |
0.0, |
| 38 |
0.0 |
| 39 |
], |
| 40 |
[ |
| 41 |
[ |
| 42 |
[ |
| 43 |
1 |
| 44 |
], |
| 45 |
[ |
| 46 |
[ |
| 47 |
"_id", |
| 48 |
"UInt32" |
| 49 |
], |
| 50 |
[ |
| 51 |
"_score", |
| 52 |
"Int32" |
| 53 |
], |
| 54 |
[ |
| 55 |
"comment", |
| 56 |
"Comments" |
| 57 |
], |
| 58 |
[ |
| 59 |
"content", |
| 60 |
"Text" |
| 61 |
] |
| 62 |
], |
| 63 |
[ |
| 64 |
1, |
| 65 |
10, |
| 66 |
1, |
| 67 |
"Groonga is fast!" |
| 68 |
] |
| 69 |
] |
| 70 |
] |
| 71 |
] |