Search code examples
vectorredis

Redis Vector Radius Search


I saw in the Redis document that querying all vectors within a given radius is supported, but my use case is to just get the number/count of vectors which are within the given radius, what is the most efficient way to achieve my use case with Redis vector capabilities? Thank you!


Solution

  • You can add LIMIT 0 0 at the end of your query or within the optional query arguments.

    From documentation:

    LIMIT first num

    ... You can use LIMIT 0 0 to count the number of documents in the result set without actually returning them.