Executing full-text queries by using Redis template #2908
Labels
for: team-attention
An issue we need to discuss as a team to make progress
status: waiting-for-triage
An issue we've not yet triaged
Hi,
Context:
I have a Spring Boot 3.2.3 app which uses spring-boot-starter-data-redis. We have a Redis cluster on the cloud, where RediSearch module is installed and where other applications are doing inserts of hash records. My application will only be executing search queries and have read-only permission towards cluster. So index already exist and I need to find a way to use it within my full-text queries but relaying on spring-boot-starter-data-redis since redis-om-spring has currently few issues which are blocking usage of pre-created index (#437, #438 & #439).
So pre-created index is created like this:
"FT.CREATE" "company:idx" "ON" "HASH" "PREFIX" "1" "session:" "SCHEMA" "User-Name" "TAG" "SEPARATOR" "|" "Event-Timestamp" "NUMERIC" "SORTABLE"
Defining a template:
Using it:
If I were to execute above query in redis-cli, the output would be:
But in code I get a List with bytes, which I don't like and there could be potential performance issues when doing (de)serialization. The problem with
connection.execute
is that returns byte[]Question 1:
Is there a more optimal way to do issue these types of queries?
Question 2:
Is there a way to configure Redis template so when it issues these types of queries to return a list of entities instead of raw bytes?
The text was updated successfully, but these errors were encountered: