How to use regex in Spring data elasticsearch Criteria?

Viewed 114

I have to build complex request to elastic search, using spring.

Filter looks like:

field1 equals “string1” 
AND
field2 equals “string2”
AND
(field3 matches “regex3” OR field4 matches “regex4”)

I’m trying to use class Criteria to build this request, but I cannot find examples how to use regex in it.

I’m new in elasticsearch, so if you know another practice how to get data with this filter, please tell me :)

1 Answers

Spring Data Elasticsearch does not support that in the Criteria classes as there is no Elasticsearch search available that processes uses regular expressions.

Related