I am working on a Kotlin Spring Boot application and I want to use Redis OM Spring to store documents in Redis and perform filtering/search operations on their fields.
For example, I have a document like:
@Document("orders")
data class OrderDocument(
@Id
var orderId: String = "",
var orderDate: String = "",
var customerName: String = "",
var amount: Double = 0.0,
var status: String = ""
)
I want to perform filtering operations such as:
Find orders by
customerNameFind orders by
statusFind orders where
amountis greater than a valueCombine multiple filters
I understand that Redis OM Spring provides annotations such as @Indexed and @Searchable, but I am not sure how to configure Redis OM Spring correctly in a Kotlin Spring Boot project.
I would like to know:
What dependencies are required?
How should Redis OM Spring be configured?
How should I configure the Redis connection?
How should I annotate my
OrderDocumentfields?How should I create the repository?
How can I write filtering queries using Redis OM Spring?
For example, I am trying to understand whether something like this is the correct approach:
@Indexed
var status: String = ""
and then using a repository to search/filter the documents.
I am currently getting configuration/bean errors while trying to set this up.
What is the recommended configuration and repository structure for Redis OM Spring with Kotlin and Spring Boot?