| 1 |
table_create Comments TABLE_HASH_KEY UInt32 |
| 2 |
column_create Comments content COLUMN_SCALAR ShortText |
| 3 |
|
| 4 |
table_create Articles TABLE_NO_KEY |
| 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, "content": "I'm using groonga too!"}, |
| 20 |
{"_key": 2, "content": "I'm using groonga and mroonga!"}, |
| 21 |
{"_key": 3, "content": "I'm using mroonga too!"} |
| 22 |
] |
| 23 |
|
| 24 |
load --table Articles |
| 25 |
[ |
| 26 |
{"content": "Groonga is fast!", "comment": 1}, |
| 27 |
{"content": "Groonga is useful!"}, |
| 28 |
{"content": "Mroonga is fast!", "comment": 3} |
| 29 |
] |
| 30 |
|
| 31 |
select Articles \ |
| 32 |
--match_columns 'comment.content * 10' --query groonga \ |
| 33 |
--output_columns "_id, _score, *" |