|
| 1 | +// |
| 2 | +// CSV spec for FUSE command |
| 3 | +// |
| 4 | + |
| 5 | +simpleFuse |
| 6 | +required_capability: fork_v9 |
| 7 | +required_capability: fuse |
| 8 | +required_capability: match_operator_colon |
| 9 | + |
| 10 | +FROM employees METADATA _id, _index, _score |
| 11 | +| FORK ( WHERE emp_no:10001 ) |
| 12 | + ( WHERE emp_no:10002 ) |
| 13 | +| FUSE |
| 14 | +| EVAL _score = round(_score, 4) |
| 15 | +| KEEP _score, _fork, emp_no |
| 16 | +| SORT _score, _fork, emp_no |
| 17 | +; |
| 18 | + |
| 19 | +_score:double | _fork:keyword | emp_no:integer |
| 20 | +0.0164 | fork1 | 10001 |
| 21 | +0.0164 | fork2 | 10002 |
| 22 | +; |
| 23 | + |
| 24 | +fuseWithMatchAndScore |
| 25 | +required_capability: fork_v9 |
| 26 | +required_capability: fuse |
| 27 | +required_capability: match_operator_colon |
| 28 | + |
| 29 | +FROM books METADATA _id, _index, _score |
| 30 | +| FORK ( WHERE title:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) |
| 31 | + ( WHERE author:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) |
| 32 | +| FUSE |
| 33 | +| SORT _score DESC, _id, _index |
| 34 | +| EVAL _fork = mv_sort(_fork) |
| 35 | +| EVAL _score = round(_score, 5) |
| 36 | +| KEEP _score, _fork, _id |
| 37 | +; |
| 38 | + |
| 39 | +_score:double | _fork:keyword | _id:keyword |
| 40 | +0.03279 | [fork1, fork2] | 4 |
| 41 | +0.01613 | fork1 | 56 |
| 42 | +0.01613 | fork2 | 60 |
| 43 | +0.01587 | fork2 | 1 |
| 44 | +0.01587 | fork1 | 26 |
| 45 | +; |
| 46 | + |
| 47 | +fuseWithDisjunctionAndPostFilter |
| 48 | +required_capability: fork_v9 |
| 49 | +required_capability: fuse |
| 50 | +required_capability: match_operator_colon |
| 51 | + |
| 52 | +FROM books METADATA _id, _index, _score |
| 53 | +| FORK ( WHERE title:"Tolkien" OR author:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) |
| 54 | + ( WHERE author:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) |
| 55 | +| FUSE |
| 56 | +| SORT _score DESC, _id, _index |
| 57 | +| EVAL _fork = mv_sort(_fork) |
| 58 | +| EVAL _score = round(_score, 5) |
| 59 | +| KEEP _score, _fork, _id |
| 60 | +| WHERE _score > 0.014 |
| 61 | +; |
| 62 | + |
| 63 | +_score:double | _fork:keyword | _id:keyword |
| 64 | +0.03252 | [fork1, fork2] | 60 |
| 65 | +0.032 | [fork1, fork2] | 1 |
| 66 | +0.01639 | fork2 | 4 |
| 67 | +0.01587 | fork1 | 40 |
| 68 | +; |
| 69 | + |
| 70 | +fuseWithStats |
| 71 | +required_capability: fork_v9 |
| 72 | +required_capability: fuse |
| 73 | +required_capability: match_operator_colon |
| 74 | + |
| 75 | +FROM books METADATA _id, _index, _score |
| 76 | +| FORK ( WHERE title:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) |
| 77 | + ( WHERE author:"Tolkien" | SORT _score, _id DESC | LIMIT 3 ) |
| 78 | + ( WHERE author:"Ursula K. Le Guin" AND title:"short stories" | SORT _score, _id DESC | LIMIT 3) |
| 79 | +| FUSE |
| 80 | +| STATS count_fork=COUNT(*) BY _fork |
| 81 | +| SORT _fork |
| 82 | +; |
| 83 | + |
| 84 | +count_fork:long | _fork:keyword |
| 85 | +3 | fork1 |
| 86 | +3 | fork2 |
| 87 | +1 | fork3 |
| 88 | +; |
| 89 | + |
| 90 | +fuseWithMultipleForkBranches |
| 91 | +required_capability: fork_v9 |
| 92 | +required_capability: fuse |
| 93 | +required_capability: match_operator_colon |
| 94 | + |
| 95 | +FROM books METADATA _id, _index, _score |
| 96 | +| FORK (WHERE author:"Keith Faulkner" AND qstr("author:Rory or author:Beverlie") | SORT _score, _id DESC | LIMIT 3) |
| 97 | + (WHERE author:"Ursula K. Le Guin" | SORT _score, _id DESC | LIMIT 3) |
| 98 | + (WHERE title:"Tolkien" AND author:"Tolkien" AND year > 2000 AND mv_count(author) == 1 | SORT _score, _id DESC | LIMIT 3) |
| 99 | + (WHERE match(author, "Keith Faulkner") AND match(author, "Rory Tyger") | SORT _score, _id DESC | LIMIT 3) |
| 100 | +| FUSE |
| 101 | +| SORT _score DESC, _id, _index |
| 102 | +| EVAL _fork = mv_sort(_fork) |
| 103 | +| EVAL _score = round(_score, 4) |
| 104 | +| EVAL title = trim(substring(title, 1, 20)) |
| 105 | +| KEEP _score, author, title, _fork |
| 106 | +; |
| 107 | + |
| 108 | +_score:double | author:keyword | title:keyword | _fork:keyword |
| 109 | +0.0328 | [Keith Faulkner, Rory Tyger] | Pop! Went Another Ba | [fork1, fork4] |
| 110 | +0.0164 | J.R.R. Tolkien | Letters of J R R Tol | fork3 |
| 111 | +0.0164 | Ursula K. Le Guin | The wind's twelve qu | fork2 |
| 112 | +0.0161 | [Beverlie Manson, Keith Faulkner] | Rainbow's End: A Mag | fork1 |
| 113 | +0.0161 | Ursula K. Le Guin | The Word For World i | fork2 |
| 114 | +0.0159 | Ursula K. Le Guin | The Dispossessed | fork2 |
| 115 | +; |
| 116 | + |
| 117 | +fuseWithSemanticSearch |
| 118 | +required_capability: fork_v9 |
| 119 | +required_capability: fuse |
| 120 | +required_capability: semantic_text_field_caps |
| 121 | +required_capability: metadata_score |
| 122 | + |
| 123 | +FROM semantic_text METADATA _id, _score, _index |
| 124 | +| FORK ( WHERE semantic_text_field:"something" | SORT _score DESC | LIMIT 2) |
| 125 | + ( WHERE semantic_text_field:"something else" | SORT _score DESC | LIMIT 2) |
| 126 | +| FUSE |
| 127 | +| SORT _score DESC, _id, _index |
| 128 | +| EVAL _score = round(_score, 4) |
| 129 | +| EVAL _fork = mv_sort(_fork) |
| 130 | +| KEEP _fork, _score, _id, semantic_text_field |
| 131 | +; |
| 132 | + |
| 133 | +_fork:keyword | _score:double | _id:keyword | semantic_text_field:keyword |
| 134 | +[fork1, fork2] | 0.0328 | 2 | all we have to decide is what to do with the time that is given to us |
| 135 | +[fork1, fork2] | 0.0323 | 3 | be excellent to each other |
| 136 | +; |
0 commit comments