redis / redis-om-spring

Spring Data Redis extensions for better search, documents models, and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eq method should not escape characters

fabrizio-cannizzaro opened this issue · comments

The eq method is escaping special characters, with the result in that case return ever false

@fabrizio-cannizzaro can you post a small reproducer with some expected inputs and outputs? Thanks

Here a snippet:

SearchStream searchStream = entityStream.of(MeetingDetailDocument.class)
if (organizingEntity != null) {
stream.filter(MeetingDetailDocument$.ORGANIZING_ENTITY.eq(organizingEntity));
}
organizing entity is a String.
if we pass"S&D" to eq method, it will be escaped to "S&D" and return false, because in Redis the value is not escaped.

I believe this may have something to do with the tokenization rules in RediSearch https://redis.io/docs/interact/search-and-query/advanced-concepts/escaping/

You are right, the problem was caused by the index: if it already exist and are added new fields the index is not recreated at startup and the new field is not indexed