| 1 |
table_create Memos TABLE_HASH_KEY ShortText |
| 2 |
|
| 3 |
load --table Memos |
| 4 |
[ |
| 5 |
{"_key": "groonga"}, |
| 6 |
{"_key": "mroonga"}, |
| 7 |
{"_key": "rroonga"}, |
| 8 |
{"_key": "ruby"}, |
| 9 |
{"_key": "learn"} |
| 10 |
] |
| 11 |
|
| 12 |
table_create Notes TABLE_HASH_KEY ShortText |
| 13 |
column_create Notes memo COLUMN_SCALAR Memos |
| 14 |
column_create Notes title COLUMN_SCALAR ShortText |
| 15 |
column_create Notes content COLUMN_SCALAR ShortText |
| 16 |
|
| 17 |
column_create Memos notes COLUMN_INDEX Notes memo |
| 18 |
|
| 19 |
table_create Lexicon TABLE_PAT_KEY ShortText \ |
| 20 |
--default_tokenizer TokenNgram \ |
| 21 |
--normalizer NormalizerNFKC130 |
| 22 |
column_create Lexicon notes_title COLUMN_INDEX|WITH_POSITION Notes title |
| 23 |
column_create Lexicon notes_content COLUMN_INDEX|WITH_POSITION Notes content |
| 24 |
|
| 25 |
load --table Notes |
| 26 |
[ |
| 27 |
{"_key": "Groonga", "memo": "groonga", "title": "Groonga", "content": "Start Groonga!"}, |
| 28 |
{"_key": "Mroonga", "memo": "mroonga", "title": "Mroonga", "content": "Start Mroonga!"}, |
| 29 |
{"_key": "Rroonga", "memo": "rroonga", "title": "Rroonga", "content": "Start Rroonga!"}, |
| 30 |
{"_key": "Ruby", "memo": "ruby", "title": "Ruby", "content": "Start Ruby!"}, |
| 31 |
{"_key": "Learn", "memo": "learn", "title": "Learn", "content": "Learning Ruby and Groonga..."} |
| 32 |
] |
| 33 |
|
| 34 |
select Memos \ |
| 35 |
--match_columns "notes.title || notes.content" \ |
| 36 |
--query rroonga \ |
| 37 |
--output_columns _key,_score |