Hi all, I'm working with a large dataset of geospatial data in Redis and need to query for members within axis-aligned rectangles. What is the most efficient approach for this type of query GEOSEARCH with the BYBOX option/ FT.SEARCH with a geospatial index?

Additionally, if I need to filter the results based on another attribute stored in a hash (e.g., by a specific "type" field), which method would be more efficient: 1. Retrieving all members with GEOSEARCH and filtering them in my application 2. Using FT.SEARCH with both the geospatial and attribute filters

Any insights would be greatly appreciated! Thanks!

Comment From: maninder989

Hey @sapirshamun , I am also trying to query similar data, where I have to search based on geo location and additional attributes. Did you find optimal approach for these?

Comment From: sundb

@meiravgri please take a look.

Comment From: sapirshamun

Hi, So I didn't find yet the optimal solution. I started to work with option 1, the problem is that implementing ttl and also keep the code in sync when working with some different entries (each object has 1 id key and 1 geo key) is not trivial.

Comment From: oshadmi

@sapirshamun We do not have performance comparison of GEOSEARCH with the BYBOX option Vs. FT.SEARCH with GEOSHAPE fields, which support WKT Polygons and Points. It also depends on the data and the queries, and how indexing may improve the query performance, and with which memory overhead. There's also an option to use FT.SEARCH with GEO fields, which supports querying using lon and lat by radius, but neither here we have comparative benchmarks.

Comment From: sapirshamun

Thanks @oshadmi , I try to find a solution that allows geo search + ttl. Let's say I would choose geo search, I saw this workaround for ttl. However, it means I need 3 keys for 1 object (geo, id and one for ttl). If I want to keep adding atmoic, my only option will be using LUA script? If so, I found it hard as I need to handle all cases that not all keys were added successfully.

Also when working with index I see it's hard to implement ttl.

Thanks from advance!