diff --git a/modules/elasticsearch/src/test/java/org/elasticsearch/common/lucene/uid/UidFieldTests.java b/modules/elasticsearch/src/test/java/org/elasticsearch/common/lucene/uid/UidFieldTests.java index 6d03ce2618f..c025c524cbe 100644 --- a/modules/elasticsearch/src/test/java/org/elasticsearch/common/lucene/uid/UidFieldTests.java +++ b/modules/elasticsearch/src/test/java/org/elasticsearch/common/lucene/uid/UidFieldTests.java @@ -62,5 +62,10 @@ public class UidFieldTests { reader = writer.getReader(); assertThat(UidField.loadVersion(reader, new Term("_uid", "1")), equalTo(2l)); assertThat(UidField.loadDocIdAndVersion(reader, new Term("_uid", "1")).version, equalTo(2l)); + + writer.deleteDocuments(new Term("_uid", "1")); + reader = writer.getReader(); + assertThat(UidField.loadVersion(reader, new Term("_uid", "1")), equalTo(-1l)); + assertThat(UidField.loadDocIdAndVersion(reader, new Term("_uid", "1")).version, equalTo(-1l)); } }