1

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:

  1. Does Redis OM Spring support NotIn queries?
  2. If not, what’s the correct way to implement a NOT IN filter with Redis OM Spring? (e.g., custom @Query or another approach)

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.