| 1 |
table_create Tags TABLE_PAT_KEY ShortText |
| 2 |
[[0,0.0,0.0],true] |
| 3 |
table_create Memos TABLE_HASH_KEY ShortText |
| 4 |
[[0,0.0,0.0],true] |
| 5 |
column_create Memos tags COLUMN_VECTOR|WITH_WEIGHT Tags |
| 6 |
[[0,0.0,0.0],true] |
| 7 |
load --table Memos |
| 8 |
[ |
| 9 |
{ |
| 10 |
"_key": "Groonga is fast", |
| 11 |
"tags": { |
| 12 |
"groonga": 100 |
| 13 |
} |
| 14 |
}, |
| 15 |
{ |
| 16 |
"_key": "Mroonga is also fast", |
| 17 |
"tags": { |
| 18 |
"mroonga": 100, |
| 19 |
"groonga": 10 |
| 20 |
} |
| 21 |
}, |
| 22 |
{ |
| 23 |
"_key": "Ruby is an object oriented script language", |
| 24 |
"tags": { |
| 25 |
"ruby": 100 |
| 26 |
} |
| 27 |
} |
| 28 |
] |
| 29 |
[[0,0.0,0.0],3] |
| 30 |
column_create Tags memos_tags COLUMN_INDEX|WITH_WEIGHT Memos tags |
| 31 |
[[0,0.0,0.0],true] |
| 32 |
select Memos --filter true --adjuster 'tags @ "groonga" * 2' --output_columns _key,_score |
| 33 |
[ |
| 34 |
[ |
| 35 |
0, |
| 36 |
0.0, |
| 37 |
0.0 |
| 38 |
], |
| 39 |
[ |
| 40 |
[ |
| 41 |
[ |
| 42 |
3 |
| 43 |
], |
| 44 |
[ |
| 45 |
[ |
| 46 |
"_key", |
| 47 |
"ShortText" |
| 48 |
], |
| 49 |
[ |
| 50 |
"_score", |
| 51 |
"Int32" |
| 52 |
] |
| 53 |
], |
| 54 |
[ |
| 55 |
"Groonga is fast", |
| 56 |
203 |
| 57 |
], |
| 58 |
[ |
| 59 |
"Mroonga is also fast", |
| 60 |
23 |
| 61 |
], |
| 62 |
[ |
| 63 |
"Ruby is an object oriented script language", |
| 64 |
1 |
| 65 |
] |
| 66 |
] |
| 67 |
] |
| 68 |
] |