I’m using Redis OM Spring with a simple repository:
@Document(value = "Marker", indexName = "MarkerIdx")
data class RedisMarker(
//other indexed
@Indexed
var type: String = "",
)
interface MarkerRepository : RedisDocumentRepository<RedisMarker, String> {
fun findByTypeNotIn(types: List<String>): List<RedisMarker>?
fun findByTypeIn(types: List<String>): List<RedisMarker>?
}
When I call these methods:
markerRepo.findByTypeNotIn(listOf("1", "2", "3"))
markerRepo.findByTypeIn(listOf("1", "2", "3"))
Both generate the same Redis query:
FT.SEARCH MarkerIdx "@type:{1|2|3}" LIMIT 0 10000 DIALECT 2
But I expect NotIn to generate a negation query, something like:
FT.SEARCH MarkerIdx "-@type:{1|2|3}" LIMIT 0 10000 DIALECT 2
Questions:
- Does Redis OM Spring support NotIn queries?
- If not, what’s the correct way to implement a NOT IN filter with Redis OM Spring? (e.g., custom @Query or another approach)