| 1 |
# _database_close/_database_reopen can't use with HTTP because requests via HTTP are always |
| 2 |
# processed by workers. Workers never use primary WAL role. |
| 3 |
#@require-interface stdio |
| 4 |
|
| 5 |
#@require-feature message_pack |
| 6 |
|
| 7 |
#$GROONGA_ALLOW_DATABASE_REOPEN=yes |
| 8 |
#$GRN_WAL_ROLE=primary |
| 9 |
|
| 10 |
table_create Terms TABLE_PAT_KEY ShortText \ |
| 11 |
--normalizer NormalizerNFKC130 \ |
| 12 |
--default_tokenizer TokenNgram |
| 13 |
|
| 14 |
table_create Data TABLE_PAT_KEY ShortText |
| 15 |
|
| 16 |
column_create Terms data_key COLUMN_INDEX|WITH_POSITION Data _key |
| 17 |
|
| 18 |
load --table Data |
| 19 |
[ |
| 20 |
{"_key": "a and b and c"}, |
| 21 |
{"_key": "A and B and C"}, |
| 22 |
{"_key": "a and b and c and d and e and f"} |
| 23 |
] |
| 24 |
|
| 25 |
delete --table Data --id 2 |
| 26 |
|
| 27 |
dump |
| 28 |
|
| 29 |
_database_close |
| 30 |
|
| 31 |
#@copy-path #{db_path}.0000101 #{db_path}.0000101.wal |
| 32 |
#@add-important-log-levels notice |
| 33 |
_database_reopen |
| 34 |
#@remove-important-log-levels notice |
| 35 |
|
| 36 |
dump |
| 37 |
|
| 38 |
index_column_diff --table Terms --name data_key |
| 39 |
|
| 40 |
select Data \ |
| 41 |
--match_columns '_key * 2' \ |
| 42 |
--query d \ |
| 43 |
--output_columns _id,_key,_score |