Skip to main content
Use GEOSEARCHSTORE to run the same query as GEOSEARCH and store the matching members in another key instead of returning them. The destination is a sorted set holding the matches. By default their scores are the raw geohash values, so the destination is itself a valid geospatial index that can be queried further; with STOREDIST the score is the distance from the center in the unit of the query, which turns the result into a proximity-ordered list you can page through with ZRANGE. The destination is overwritten on every call, and it is deleted when the query matches nothing. The reply is the number of members stored. This is the usual way to materialize a “nearby” result once and then reuse it for pagination or further set operations.

Syntax

Arguments

Response

The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.
Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.

Examples

TCP examples use the TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.