Painless - compare data fields without seconds

Hi,
I would like to comapre two data fields, but i don't want to be precisely to second, minutes are enough to me.
My data fields looks like this: "Dec 2, 2019 @ 08:34:18.000" and my painless is:

doc['arrivaltime'].value.isAfter(doc['schedulearrival'].value

How can i get rid of seconds ?

you can to set the second to zero with the .withSecond(0) method of one of the java time classes (I have not tested this, if this requires some more conversion before that).

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.