redis-om-spring icon indicating copy to clipboard operation
redis-om-spring copied to clipboard

@Query and escaping

Open alexvasseur opened this issue 1 year ago • 0 comments

using 0.5.2-SNAPSHOT

@TagIndexed
@SerializedName(value = "genre", alternate = "Genre")
private List<String> genre;

Page<Movie> findByGenre(@Param("genre") Set<String> genre, Pageable pageable); => works with "Sci-Fi" as Redis OM is escaping automatically the hyphen http://localhost:8080/movie/genre/?genres=Sci-Fi&page=0&size=10 "FT.SEARCH" "io.redis.model.MovieIdx" "@genre:{Sci\-Fi}"

@Query("@genre:{$genre}") Page<Movie> findByGenre(@Param("genre") Set<String> genre, Pageable pageable); => fails as "Sci-Fi" is not escaped for RediSearch in the @Query

is that an expected behavior and/or what would be the SpEL to properly escape in the @Query( ...) syntax ?

alexvasseur avatar Jul 21 '22 08:07 alexvasseur