| 1 |
table_create Entries TABLE_NO_KEY |
| 2 |
[[0,0.0,0.0],true] |
| 3 |
column_create Entries title COLUMN_SCALAR ShortText |
| 4 |
[[0,0.0,0.0],true] |
| 5 |
column_create Entries contents COLUMN_VECTOR ShortText |
| 6 |
[[0,0.0,0.0],true] |
| 7 |
table_create Tokens TABLE_PAT_KEY ShortText --default_tokenizer TokenNgram --normalizer NormalizerNFKC130 |
| 8 |
[[0,0.0,0.0],true] |
| 9 |
column_create Tokens entries_title COLUMN_INDEX|WITH_POSITION Entries title |
| 10 |
[[0,0.0,0.0],true] |
| 11 |
column_create Tokens entries_contents COLUMN_INDEX|WITH_SECTION|WITH_POSITION Entries contents |
| 12 |
[[0,0.0,0.0],true] |
| 13 |
load --table Entries |
| 14 |
[ |
| 15 |
{ |
| 16 |
"title": "Groonga and MySQL", |
| 17 |
"contents": [ |
| 18 |
"It is a full text search engine", |
| 19 |
"MySQL is a RDBMS", |
| 20 |
"Mroonga is a MySQL storage engine" |
| 21 |
] |
| 22 |
} |
| 23 |
] |
| 24 |
[[0,0.0,0.0],1] |
| 25 |
select Entries --output_columns 'snippet(contents, {"default": ["default"]}), contents' --match_columns 'title' --query Groonga |
| 26 |
[ |
| 27 |
[ |
| 28 |
0, |
| 29 |
0.0, |
| 30 |
0.0 |
| 31 |
], |
| 32 |
[ |
| 33 |
[ |
| 34 |
[ |
| 35 |
1 |
| 36 |
], |
| 37 |
[ |
| 38 |
[ |
| 39 |
"snippet", |
| 40 |
null |
| 41 |
], |
| 42 |
[ |
| 43 |
"contents", |
| 44 |
"ShortText" |
| 45 |
] |
| 46 |
], |
| 47 |
[ |
| 48 |
[ |
| 49 |
"default" |
| 50 |
], |
| 51 |
[ |
| 52 |
"It is a full text search engine", |
| 53 |
"MySQL is a RDBMS", |
| 54 |
"Mroonga is a MySQL storage engine" |
| 55 |
] |
| 56 |
] |
| 57 |
] |
| 58 |
] |
| 59 |
] |