2

Does redis support geospatial and vector search like (knn) in the same query. I understand a simple filter query feeding into knn search like the one below would work

"(@title:Matrix @year:[2020 2022])=>[KNN 10 @v $B]"

I am curious if the filter section can do also do "@location:[long lat radius]". I am hearing this may not be supported but just curious if anyone is aware of a recent change.

Also, if not redis, what other open source vector databases that are easy to setup can do this?

user3221430
  • 71
  • 1
  • 6
  • What source told you it's not supported? I'm interested if there is misleading info out there – A. Guy Apr 27 '23 at 14:20
  • 1
    It was one of the older posts. It looks like this support was added in 2.4, if so I am guessing that post was referring an older version. – user3221430 Apr 28 '23 at 03:45
  • there is support to geo polygon search coming in the next stack release to deal with geometries and points – Adriano Amaral May 04 '23 at 16:47

1 Answers1

2

YES.

You can pass any RediSearch command as the filter for the KNN section, as long as it's not including another KNN query.

"@location:[long lat radius]=>[KNN 10 @v $B]"
"(<almost anything here>)=>[KNN 10 @v $B]"

RediSearch also supports range queries on vector fields that you can include in the filter section of the query

"@v:[VECTOR_RANGE 0.2 $B1]=>[KNN 10 @v $B2]"
A. Guy
  • 500
  • 1
  • 3
  • 10