| 1 |
table_create Articles TABLE_HASH_KEY ShortText |
| 2 |
|
| 3 |
table_create Comments TABLE_NO_KEY |
| 4 |
column_create Comments article COLUMN_SCALAR Articles |
| 5 |
column_create Comments content COLUMN_SCALAR ShortText |
| 6 |
|
| 7 |
column_create Articles content COLUMN_SCALAR Text |
| 8 |
column_create Articles comments COLUMN_INDEX Comments article |
| 9 |
|
| 10 |
table_create Terms TABLE_PAT_KEY ShortText \ |
| 11 |
--default_tokenizer TokenBigram \ |
| 12 |
--normalizer NormalizerNFKC130 |
| 13 |
column_create Terms articles_content COLUMN_INDEX|WITH_POSITION \ |
| 14 |
Articles content |
| 15 |
column_create Terms comments_content COLUMN_INDEX|WITH_POSITION \ |
| 16 |
Comments content |
| 17 |
|
| 18 |
load --table Articles |
| 19 |
[ |
| 20 |
{"_key": "article-1", "content": "Groonga is fast!"}, |
| 21 |
{"_key": "article-2", "content": "Groonga is useful!"}, |
| 22 |
{"_key": "article-3", "content": "Mroonga is fast!"} |
| 23 |
] |
| 24 |
|
| 25 |
load --table Comments |
| 26 |
[ |
| 27 |
{"article": "article-1", "content": "I'm using Groonga too!"}, |
| 28 |
{"article": "article-3", "content": "I'm using Mroonga!"}, |
| 29 |
{"article": "article-1", "content": "I'm using PGroonga!"} |
| 30 |
] |
| 31 |
|
| 32 |
log_level --level info |
| 33 |
#@add-important-log-levels info |
| 34 |
#@add-ignore-log-pattern /\A\[io\]/ |
| 35 |
select Articles --match_columns comments.content --query groonga \ |
| 36 |
--output_columns "_key, _score, comments.content" |