From 1d89054d121f491f0687a8280535c1820508d9a6 Mon Sep 17 00:00:00 2001 From: Mingron <41795715+1autodidact@users.noreply.github.com> Date: Sat, 27 Apr 2024 17:13:58 +0800 Subject: [PATCH] fix scripted-and-runtime-fields.adoc Original Pull Request #2902 Closes #2903 --- .../ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc index 7c5d730e2..38345d424 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc @@ -194,7 +194,7 @@ In the following code this is used to run a query for a given gender and maximum var runtimeField = new RuntimeField("age", "long", """ <.> Instant currentDate = Instant.ofEpochMilli(new Date().getTime()); - Instant startDate = doc['birth-date'].value.toInstant(); + Instant startDate = doc['birthDate'].value.toInstant(); emit (ChronoUnit.DAYS.between(startDate, currentDate) / 365); """);