Closed kmanchev-hedgeserv closed 4 months ago
Either use @Indexed
or @Searchable
but not both on the same field. Also @Id
is by default indexed as TAG so no need to add the @Indexed
on @Id
. Use @Searchble
only if you need full-text search capabilities, for field like clientCode
you are probably searching by exact value, right?
To troubleshoot it, also provide the FT.INFO "com.path.to.my.dto.ConcreteObjectDTOIdx"
It worked as expected. Thanks !
Hello, I encountered the issue of not able to filter on a field from my Object. The object looks like this: one abstract class that is extended by multiple objects that I am saving in Redis
the EntityStream code that I try to filter with:
entityStream.of(ConcreteObjectDTO.class) .filter(ConcreteObjectDTO$.CLIENT_CODE.eq("0001QA")) .collect(Collectors.toSet());
In RedisInsight I see the fallowing query:"FT.SEARCH" "com.path.to.my.dto.ConcreteObjectDTOIdx" "( @clientCode:0001QA)" "LIMIT" "0" "10000" "DIALECT" "1"
This query returns 0 entries.If I try filtering by id, it works as expected:
entityStream.of(ConcreteObjectDTO.class) .filter(ConcreteObjectDTO$.ID.eq("0001QA:some:specific:id")) .collect(Collectors.toSet());
the query:
"FT.SEARCH" "com.path.to.my.dto.ConcreteObjectDTOIdx" "( @id:{0001QA\\:some\\:specific\\:id})" "LIMIT" "0" "10000" "DIALECT" "1"
I tried to edit the original query in redis CLI by adding curly braces to the client code value like this :
"FT.SEARCH" "com.path.to.my.dto.ConcreteObjectDTOIdx" "( @clientCode:{0001QA})" "LIMIT" "0" "10000" "DIALECT" "1"
and it works, but I am unable to figure out how to translate it to an entityStream code to behave the same... We use redis-om-spring version: 0.9.1 and java version: 21