Search code examples
spring-dataspring-data-redis

How to use COUNT option with Redis Repositories (GeoOperations)


I'm using Spring Data Redis with Geospatial Index. Every query method work. I would like to use the COUNT option, but I didn't find any more complex example in the documentation. Does anyone knows how to use the COUNT option at this context?


Solution

  • You can use Pageable to limit results. Staying on page 0 with e.g. Pageable.of(0, 10) limits the results to 10. However the number of items per page is not passed on to the COUNT option of the GEORADIUS command.
    I've opened DATAREDIS-666 for this.