redis / go-redis

Redis Go client
https://redis.uptrace.dev
BSD 2-Clause "Simplified" License
19.81k stars 2.34k forks source link

ERR could not decode requested zset member #2833

Open dropthemasquerade opened 8 months ago

dropthemasquerade commented 8 months ago

My Code


// FindNearTruck geosearch geohash FROMLONLAT 109.33 24.3 BYRADIUS 200 km ASC
func FindNearTruck(ctx context.Context, long, lat float64, r float64, sort string) []string {
    //
    q := &redis.GeoSearchQuery{
        Member:    "FROMLONLAT",
        Longitude: long,
        Latitude:  lat,
        //Radius:     r,
        //RadiusUnit: "km",
        Sort:      sort,
        BoxWidth:  200,
        BoxHeight: 200,
        BoxUnit:   "km",
    }
    log.WithField("q", q).Info("=================q")
    //result := make([]string, 0)
    result, err := db.RDB.GeoSearch(ctx,"geohash", q).Result()
    if err != nil {
        log.Fatal(err)
        return nil
    }
    log.WithField("q", q).WithField("result", result).
        Info("return")
    return result
}

Expected Behavior

return a list of trucks

Current Behavior

ERR could not decode requested zset member

Possible Solution

No found yet

Steps to Reproduce

  1. geoadd geohash 109.33 24.3 6438ac767c34defda10f1220
  2. i can search by redis-cli
redis-bug