@@ -923,19 +923,19 @@ public void testSearchWithDateINOperator() throws IOException {
923923 }
924924
925925 @ Test
926- public void testSearchWithEarliest () throws IOException {
926+ public void testSearchWithAbsoluteEarliestAndNow () throws IOException {
927927 JSONObject result1 =
928928 executeQuery (
929929 String .format (
930- "search source=%s earliest='2025-08-01 03:47:41' | fields @timestamp" ,
930+ "search source=%s earliest='2025-08-01 03:47:41' latest=now | fields @timestamp" ,
931931 TEST_INDEX_TIME_DATA ));
932932 verifySchema (result1 , schema ("@timestamp" , "timestamp" ));
933933 verifyDataRows (result1 , rows ("2025-08-01 03:47:41" ));
934934
935935 JSONObject result0 =
936936 executeQuery (
937937 String .format (
938- "search source=%s earliest='2025-08-01 03:47:42' | fields @timestamp" ,
938+ "search source=%s earliest='2025-08-01 03:47:42' latest=now() | fields @timestamp" ,
939939 TEST_INDEX_TIME_DATA ));
940940 verifyNumOfRows (result0 , 0 );
941941
@@ -946,4 +946,16 @@ public void testSearchWithEarliest() throws IOException {
946946 TEST_INDEX_TIME_DATA ));
947947 verifyDataRows (result2 , rows ("2025-08-01 02:00:56" ), rows ("2025-08-01 03:47:41" ));
948948 }
949+
950+ @ Test
951+ public void testSearchWithChainedRelativeTimeRange () throws IOException {
952+ JSONObject result1 =
953+ executeQuery (
954+ String .format (
955+ "search source=%s earliest='2025-08-01 03:47:41' latest='+10months@year' | fields"
956+ + " @timestamp" ,
957+ TEST_INDEX_TIME_DATA ));
958+ verifySchema (result1 , schema ("@timestamp" , "timestamp" ));
959+ verifyDataRows (result1 , rows ("2025-08-01 03:47:41" ));
960+ }
949961}
0 commit comments