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