diff --git a/server/src/test/java/org/opensearch/index/mapper/IpFieldTypeTests.java b/server/src/test/java/org/opensearch/index/mapper/IpFieldTypeTests.java index e848700850800..0a2435553b19e 100644 --- a/server/src/test/java/org/opensearch/index/mapper/IpFieldTypeTests.java +++ b/server/src/test/java/org/opensearch/index/mapper/IpFieldTypeTests.java @@ -83,14 +83,20 @@ public void testTermQuery() { Query query = InetAddressPoint.newExactQuery("field", InetAddresses.forString(ip)); assertEquals( - new IndexOrDocValuesQuery(query, SortedSetDocValuesField.newSlowExactQuery("field", new BytesRef(ip))), + new IndexOrDocValuesQuery( + query, + SortedSetDocValuesField.newSlowExactQuery("field", new BytesRef(((PointRangeQuery) query).getLowerPoint())) + ), ft.termQuery(ip, null) ); ip = "192.168.1.7"; query = InetAddressPoint.newExactQuery("field", InetAddresses.forString(ip)); assertEquals( - new IndexOrDocValuesQuery(query, SortedSetDocValuesField.newSlowExactQuery("field", new BytesRef(ip))), + new IndexOrDocValuesQuery( + query, + SortedSetDocValuesField.newSlowExactQuery("field", new BytesRef(((PointRangeQuery) query).getLowerPoint())) + ), ft.termQuery(ip, null) );