diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/PackedArrayIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/PackedArrayIndexFieldData.java index 6cc4fac5709..603407beeb7 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/PackedArrayIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/PackedArrayIndexFieldData.java @@ -261,7 +261,7 @@ public class PackedArrayIndexFieldData extends AbstractIndexFieldData 0) { // last page estimation pageIndex++; - if (pageMaxOrdinal == Long.MAX_VALUE) { + if (pageMaxOrdinal == Long.MIN_VALUE) { // empty page - will use the null reader which just stores size pagedSingleValuesSize += RamUsageEstimator.alignObjectSize(RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + RamUsageEstimator.NUM_BYTES_INT); diff --git a/src/test/java/org/elasticsearch/index/fielddata/LongFieldDataTests.java b/src/test/java/org/elasticsearch/index/fielddata/LongFieldDataTests.java index f9ae10167eb..092e4c27af8 100644 --- a/src/test/java/org/elasticsearch/index/fielddata/LongFieldDataTests.java +++ b/src/test/java/org/elasticsearch/index/fielddata/LongFieldDataTests.java @@ -281,7 +281,7 @@ public class LongFieldDataTests extends AbstractNumericFieldDataTests { }, SINGLE_VALUED_SPARSE_RANDOM { public int numValues(Random r) { - return r.nextFloat() < 0.1f ? 1 : 0; + return r.nextFloat() < 0.01 ? 1 : 0; } @Override @@ -291,7 +291,7 @@ public class LongFieldDataTests extends AbstractNumericFieldDataTests { }, MULTI_VALUED_SPARSE_RANDOM { public int numValues(Random r) { - return r.nextFloat() < 0.1f ? 1 + r.nextInt(5) : 0; + return r.nextFloat() < 0.01f ? 1 + r.nextInt(5) : 0; } @Override