diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:40:55 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 22:40:55 +0100 |
| commit | 5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda (patch) | |
| tree | 1acdfa5220cd13b7be43a2a01368e80d306473ca /examples/redis-unstable/src/commands/geosearch.json | |
| parent | c7ab12bba64d9c20ccd79b132dac475f7bc3923e (diff) | |
| download | crep-5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda.tar.gz | |
Add Redis source code for testing
Diffstat (limited to 'examples/redis-unstable/src/commands/geosearch.json')
| -rw-r--r-- | examples/redis-unstable/src/commands/geosearch.json | 267 |
1 files changed, 267 insertions, 0 deletions
diff --git a/examples/redis-unstable/src/commands/geosearch.json b/examples/redis-unstable/src/commands/geosearch.json new file mode 100644 index 0000000..b2e2825 --- /dev/null +++ b/examples/redis-unstable/src/commands/geosearch.json | |||
| @@ -0,0 +1,267 @@ | |||
| 1 | { | ||
| 2 | "GEOSEARCH": { | ||
| 3 | "summary": "Queries a geospatial index for members inside an area of a box or a circle.", | ||
| 4 | "complexity": "O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape", | ||
| 5 | "group": "geo", | ||
| 6 | "since": "6.2.0", | ||
| 7 | "arity": -7, | ||
| 8 | "function": "geosearchCommand", | ||
| 9 | "history": [ | ||
| 10 | [ | ||
| 11 | "7.0.0", | ||
| 12 | "Added support for uppercase unit names." | ||
| 13 | ] | ||
| 14 | ], | ||
| 15 | "command_flags": [ | ||
| 16 | "READONLY" | ||
| 17 | ], | ||
| 18 | "acl_categories": [ | ||
| 19 | "GEO" | ||
| 20 | ], | ||
| 21 | "key_specs": [ | ||
| 22 | { | ||
| 23 | "flags": [ | ||
| 24 | "RO", | ||
| 25 | "ACCESS" | ||
| 26 | ], | ||
| 27 | "begin_search": { | ||
| 28 | "index": { | ||
| 29 | "pos": 1 | ||
| 30 | } | ||
| 31 | }, | ||
| 32 | "find_keys": { | ||
| 33 | "range": { | ||
| 34 | "lastkey": 0, | ||
| 35 | "step": 1, | ||
| 36 | "limit": 0 | ||
| 37 | } | ||
| 38 | } | ||
| 39 | } | ||
| 40 | ], | ||
| 41 | "arguments": [ | ||
| 42 | { | ||
| 43 | "name": "key", | ||
| 44 | "type": "key", | ||
| 45 | "key_spec_index": 0 | ||
| 46 | }, | ||
| 47 | { | ||
| 48 | "name": "from", | ||
| 49 | "type": "oneof", | ||
| 50 | "arguments": [ | ||
| 51 | { | ||
| 52 | "token": "FROMMEMBER", | ||
| 53 | "name": "member", | ||
| 54 | "type": "string" | ||
| 55 | }, | ||
| 56 | { | ||
| 57 | "token": "FROMLONLAT", | ||
| 58 | "name": "fromlonlat", | ||
| 59 | "type": "block", | ||
| 60 | "arguments": [ | ||
| 61 | { | ||
| 62 | "name": "longitude", | ||
| 63 | "type": "double" | ||
| 64 | }, | ||
| 65 | { | ||
| 66 | "name": "latitude", | ||
| 67 | "type": "double" | ||
| 68 | } | ||
| 69 | ] | ||
| 70 | } | ||
| 71 | ] | ||
| 72 | }, | ||
| 73 | { | ||
| 74 | "name": "by", | ||
| 75 | "type": "oneof", | ||
| 76 | "arguments": [ | ||
| 77 | { | ||
| 78 | "name": "circle", | ||
| 79 | "type": "block", | ||
| 80 | "arguments": [ | ||
| 81 | { | ||
| 82 | "token": "BYRADIUS", | ||
| 83 | "name": "radius", | ||
| 84 | "type": "double" | ||
| 85 | }, | ||
| 86 | { | ||
| 87 | "name": "unit", | ||
| 88 | "type": "oneof", | ||
| 89 | "arguments": [ | ||
| 90 | { | ||
| 91 | "name": "m", | ||
| 92 | "type": "pure-token", | ||
| 93 | "token": "m" | ||
| 94 | }, | ||
| 95 | { | ||
| 96 | "name": "km", | ||
| 97 | "type": "pure-token", | ||
| 98 | "token": "km" | ||
| 99 | }, | ||
| 100 | { | ||
| 101 | "name": "ft", | ||
| 102 | "type": "pure-token", | ||
| 103 | "token": "ft" | ||
| 104 | }, | ||
| 105 | { | ||
| 106 | "name": "mi", | ||
| 107 | "type": "pure-token", | ||
| 108 | "token": "mi" | ||
| 109 | } | ||
| 110 | ] | ||
| 111 | } | ||
| 112 | ] | ||
| 113 | }, | ||
| 114 | { | ||
| 115 | "name": "box", | ||
| 116 | "type": "block", | ||
| 117 | "arguments": [ | ||
| 118 | { | ||
| 119 | "token": "BYBOX", | ||
| 120 | "name": "width", | ||
| 121 | "type": "double" | ||
| 122 | }, | ||
| 123 | { | ||
| 124 | "name": "height", | ||
| 125 | "type": "double" | ||
| 126 | }, | ||
| 127 | { | ||
| 128 | "name": "unit", | ||
| 129 | "type": "oneof", | ||
| 130 | "arguments": [ | ||
| 131 | { | ||
| 132 | "name": "m", | ||
| 133 | "type": "pure-token", | ||
| 134 | "token": "m" | ||
| 135 | }, | ||
| 136 | { | ||
| 137 | "name": "km", | ||
| 138 | "type": "pure-token", | ||
| 139 | "token": "km" | ||
| 140 | }, | ||
| 141 | { | ||
| 142 | "name": "ft", | ||
| 143 | "type": "pure-token", | ||
| 144 | "token": "ft" | ||
| 145 | }, | ||
| 146 | { | ||
| 147 | "name": "mi", | ||
| 148 | "type": "pure-token", | ||
| 149 | "token": "mi" | ||
| 150 | } | ||
| 151 | ] | ||
| 152 | } | ||
| 153 | ] | ||
| 154 | } | ||
| 155 | ] | ||
| 156 | }, | ||
| 157 | { | ||
| 158 | "name": "order", | ||
| 159 | "type": "oneof", | ||
| 160 | "optional": true, | ||
| 161 | "arguments": [ | ||
| 162 | { | ||
| 163 | "name": "asc", | ||
| 164 | "type": "pure-token", | ||
| 165 | "token": "ASC" | ||
| 166 | }, | ||
| 167 | { | ||
| 168 | "name": "desc", | ||
| 169 | "type": "pure-token", | ||
| 170 | "token": "DESC" | ||
| 171 | } | ||
| 172 | ] | ||
| 173 | }, | ||
| 174 | { | ||
| 175 | "name": "count-block", | ||
| 176 | "type": "block", | ||
| 177 | "optional": true, | ||
| 178 | "arguments": [ | ||
| 179 | { | ||
| 180 | "token": "COUNT", | ||
| 181 | "name": "count", | ||
| 182 | "type": "integer" | ||
| 183 | }, | ||
| 184 | { | ||
| 185 | "name": "any", | ||
| 186 | "token": "ANY", | ||
| 187 | "type": "pure-token", | ||
| 188 | "optional": true | ||
| 189 | } | ||
| 190 | ] | ||
| 191 | }, | ||
| 192 | { | ||
| 193 | "name": "withcoord", | ||
| 194 | "token": "WITHCOORD", | ||
| 195 | "type": "pure-token", | ||
| 196 | "optional": true | ||
| 197 | }, | ||
| 198 | { | ||
| 199 | "name": "withdist", | ||
| 200 | "token": "WITHDIST", | ||
| 201 | "type": "pure-token", | ||
| 202 | "optional": true | ||
| 203 | }, | ||
| 204 | { | ||
| 205 | "name": "withhash", | ||
| 206 | "token": "WITHHASH", | ||
| 207 | "type": "pure-token", | ||
| 208 | "optional": true | ||
| 209 | } | ||
| 210 | ], | ||
| 211 | "reply_schema": { | ||
| 212 | "description": "Array of matched members information", | ||
| 213 | "anyOf": [ | ||
| 214 | { | ||
| 215 | "description": "If no WITH* option is specified, array of matched members names", | ||
| 216 | "type": "array", | ||
| 217 | "items": { | ||
| 218 | "description": "name", | ||
| 219 | "type": "string" | ||
| 220 | } | ||
| 221 | }, | ||
| 222 | { | ||
| 223 | "type": "array", | ||
| 224 | "items": { | ||
| 225 | "type": "array", | ||
| 226 | "minItems": 1, | ||
| 227 | "maxItems": 4, | ||
| 228 | "items": [ | ||
| 229 | { | ||
| 230 | "description": "Matched member name", | ||
| 231 | "type": "string" | ||
| 232 | } | ||
| 233 | ], | ||
| 234 | "additionalItems": { | ||
| 235 | "oneOf": [ | ||
| 236 | { | ||
| 237 | "description": "If WITHDIST option is specified, the distance from the center as a floating point number, in the same unit specified in the radius", | ||
| 238 | "type": "string" | ||
| 239 | }, | ||
| 240 | { | ||
| 241 | "description": "If WITHHASH option is specified, the geohash integer", | ||
| 242 | "type": "integer" | ||
| 243 | }, | ||
| 244 | { | ||
| 245 | "description": "If WITHCOORD option is specified, the coordinates as a two items x,y array (longitude,latitude)", | ||
| 246 | "type": "array", | ||
| 247 | "minItems": 2, | ||
| 248 | "maxItems": 2, | ||
| 249 | "items": [ | ||
| 250 | { | ||
| 251 | "description": "latitude (x)", | ||
| 252 | "type": "number" | ||
| 253 | }, | ||
| 254 | { | ||
| 255 | "description": "longitude (y)", | ||
| 256 | "type": "number" | ||
| 257 | } | ||
| 258 | ] | ||
| 259 | } | ||
| 260 | ] | ||
| 261 | } | ||
| 262 | } | ||
| 263 | } | ||
| 264 | ] | ||
| 265 | } | ||
| 266 | } | ||
| 267 | } | ||
