我使用这个脚本来获取两个字段之间的时差:
new org.joda.time.Period(doc[firstDateField].date, doc[secondDateField].date).getHours();
问题是ES告诉我:
bbd8b73ce0b0dd070d07e63f11dcdad4fa12121d: 1: unable to resolve class org.joda.time.Period
Nov 04 10:27:21 core-01 docker[3876]: @ line 1, column 1.
Nov 04 10:27:21 core-01 docker[3876]: new Period(doc[firstDateField].date, doc[secondDateField].date).getHours();
Nov 04 10:27:21 core-01 docker[3876]: ^