| 1 |
#$GRN_QUERY_PARALLEL_OR_N_CONDITIONS_THRESHOLD=1 |
| 2 |
|
| 3 |
table_create Tags TABLE_HASH_KEY ShortText |
| 4 |
|
| 5 |
table_create Users TABLE_HASH_KEY ShortText |
| 6 |
column_create Users comment COLUMN_SCALAR ShortText |
| 7 |
column_create Users tag COLUMN_SCALAR Tags |
| 8 |
|
| 9 |
load --table Users |
| 10 |
[ |
| 11 |
{"_key": "Alice", "comment": "I'm happy!", "tag": "beginer"}, |
| 12 |
{"_key": "Bob", "comment": "Hey!", "tag": "expert"}, |
| 13 |
{"_key": "Chris", "comment": "Wow!", "tag": "beginner"} |
| 14 |
] |
| 15 |
|
| 16 |
table_create Terms TABLE_PAT_KEY ShortText \ |
| 17 |
--default_tokenizer TokenNgram \ |
| 18 |
--normalizer NormalizerNFKC130 |
| 19 |
column_create Terms users COLUMN_INDEX|WITH_POSITION|WITH_SECTION \ |
| 20 |
Users _key,comment |
| 21 |
|
| 22 |
column_create Tags users COLUMN_INDEX Users tag |
| 23 |
|
| 24 |
select Users \ |
| 25 |
--output_columns _id,_key,_score \ |
| 26 |
--sort_keys _id \ |
| 27 |
--filter 'query_parallel_or("_key * 2 || comment || tag * 10", \ |
| 28 |
"Alice", "Bob", "happy", "expert")' |