spring-projects / spring-data-redis

Provides support to increase developer productivity in Java when using Redis, a key-value store. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-redis/
Apache License 2.0
1.77k stars 1.17k forks source link

Add support for custom indexers #2546

Open uglide opened 1 year ago

uglide commented 1 year ago

Problems with the current state:

Currently, Spring Data Redis allows indexing POJOs using Redis Sets as described in https://redis.io/docs/manual/patterns/indexes/ . This approach is outdated since the release of RediSearch and has the following limitations:

Proposed solution:

Introduce new Interfaces and configuration options that allow indexing POJOs with custom Indexers based on RediSearch. Usage of custom Indexers will allow us to solve community issues, overcome the limitations mentioned above, and fine-tune Spring Data Redis for specific use cases.

An example of @Indexed annotation based on RediSearch can be found here:

https://github.com/redis/redis-om-spring/blob/main/redis-om-spring/src/main/java/com/redis/om/spring/annotations/Indexed.java

mp911de commented 1 year ago

Similar reasoning as with #2547, the natural consequence should be moving Redis Search support into the core. Once this is done, we're happy to reconsider adding this feature to Spring Data Redis.

I keep this ticket open to investigate whether we can adjust the feature scope and make a subset of this happen.

uglide commented 1 year ago

@mp911de please see my reply here https://github.com/spring-projects/spring-data-redis/issues/2547#issuecomment-1506829035. Thanks!