-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Java Code
def sdf = new SimpleDateFormat("dd-MM")
if (criteria.phDOBDateRange.from) {
basicSQL.append("and nested('policyholder', date_format(policyholder.dob, 'dd-MM') >= '${sdf.format(criteria.phDOBDateRange.from)}') ")
}
Query dsl:
{
"nested": {
"query": {
"nested": {
"query": {
"bool": {
"must": [
{
"script": {
"script": {
"source": "def date_format_663776289 = DateTimeFormatter.ofPattern('dd-MM').withZone(ZoneId.systemDefault()).format(Instant.ofEpochMilli(doc['policyholder.dob'].value.getMillis()));date_format_663776289.compareTo('01-11') >= 0",
"lang": "painless"
},
"boost": 1
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"path": "policyholder",
"ignore_unmapped": false,
"score_mode": "none",
"boost": 1
}
},
"path": "policyholder",
"ignore_unmapped": false,
"score_mode": "none",
"boost": 1
}
},
Why nested parsing repeats?
Metadata
Metadata
Assignees
Labels
No labels