| 1 |
#$GRN_QUERY_PARALLEL_OR_N_CONDITIONS_THRESHOLD=1 |
| 2 |
#$GRN_QUERY_PARALLEL_OR_N_THREADS_LIMIT=2 |
| 3 |
|
| 4 |
table_create Tags TABLE_HASH_KEY ShortText |
| 5 |
|
| 6 |
table_create Users TABLE_HASH_KEY ShortText |
| 7 |
column_create Users comment COLUMN_SCALAR ShortText |
| 8 |
column_create Users tags_by_me COLUMN_VECTOR Tags |
| 9 |
column_create Users tags_by_others COLUMN_VECTOR Tags |
| 10 |
|
| 11 |
load --table Users |
| 12 |
[ |
| 13 |
{"_key": "Alice", |
| 14 |
"tags_by_me": ["beginner", "active"], |
| 15 |
"tags_by_others": ["expert", "active"]}, |
| 16 |
{"_key": "Bob", |
| 17 |
"tags_by_me": ["expert", "passive"], |
| 18 |
"tags_by_others": ["beginner", "passive"]}, |
| 19 |
{"_key": "Chris", |
| 20 |
"tags_by_me": ["beginner", "passive"], |
| 21 |
"tags_by_others": ["active"]} |
| 22 |
] |
| 23 |
|
| 24 |
column_create Tags users COLUMN_INDEX|WITH_SECTION \ |
| 25 |
Users tags_by_me,tags_by_others |
| 26 |
|
| 27 |
select Users \ |
| 28 |
--output_columns _id,_key,tags_by_me,tags_by_others,,_score \ |
| 29 |
--sort_keys _id \ |
| 30 |
--filter 'query_parallel_or("tags_by_me * 100 || \ |
| 31 |
tags_by_others * 1000", \ |
| 32 |
"beginner active")' |