summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/search/aggregations/bucket
diff options
context:
space:
mode:
authorAdrien Grand <jpountz@gmail.com>2017-04-18 15:17:21 +0200
committerGitHub <noreply@github.com>2017-04-18 15:17:21 +0200
commit4632661bc71bb22fc577df476e70e9dfabaaae66 (patch)
tree6e10e1ffaa792c5fa46251d861736e59c9ed3404 /core/src/test/java/org/elasticsearch/search/aggregations/bucket
parentf217eb8ad8d3ecc82e2f926222b1f036b0d555b7 (diff)
Upgrade to a Lucene 7 snapshot (#24089)
We want to upgrade to Lucene 7 ahead of time in order to be able to check whether it causes any trouble to Elasticsearch before Lucene 7.0 gets released. From a user perspective, the main benefit of this upgrade is the enhanced support for sparse fields, whose resource consumption is now function of the number of docs that have a value rather than the total number of docs in the index. Some notes about the change: - it includes the deprecation of the `disable_coord` parameter of the `bool` and `common_terms` queries: Lucene has removed support for coord factors - it includes the deprecation of the `index.similarity.base` expert setting, since it was only useful to configure coords and query norms, which have both been removed - two tests have been marked with `@AwaitsFix` because of #23966, which we intend to address after the merge
Diffstat (limited to 'core/src/test/java/org/elasticsearch/search/aggregations/bucket')
-rw-r--r--core/src/test/java/org/elasticsearch/search/aggregations/bucket/range/BinaryRangeAggregatorTests.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/range/BinaryRangeAggregatorTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/range/BinaryRangeAggregatorTests.java
index 6ba6da3b55..6ed2c1a3a8 100644
--- a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/range/BinaryRangeAggregatorTests.java
+++ b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/range/BinaryRangeAggregatorTests.java
@@ -23,9 +23,9 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
-import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.TestUtil;
+import org.elasticsearch.index.fielddata.AbstractSortedSetDocValues;
import org.elasticsearch.index.fielddata.SortedBinaryDocValues;
import org.elasticsearch.search.aggregations.LeafBucketCollector;
import org.elasticsearch.search.aggregations.bucket.range.BinaryRangeAggregator.SortedBinaryRangeLeafCollector;
@@ -36,7 +36,7 @@ import com.carrotsearch.hppc.LongHashSet;
public class BinaryRangeAggregatorTests extends ESTestCase {
- private static class FakeSortedSetDocValues extends SortedSetDocValues {
+ private static class FakeSortedSetDocValues extends AbstractSortedSetDocValues {
private final BytesRef[] terms;
long[] ords;
@@ -47,8 +47,9 @@ public class BinaryRangeAggregatorTests extends ESTestCase {
}
@Override
- public void setDocument(int docID) {
+ public boolean advanceExact(int docID) {
i = 0;
+ return true;
}
@Override
@@ -145,6 +146,7 @@ public class BinaryRangeAggregatorTests extends ESTestCase {
private static class FakeSortedBinaryDocValues extends SortedBinaryDocValues {
private final BytesRef[] terms;
+ int i;
long[] ords;
FakeSortedBinaryDocValues(BytesRef[] terms) {
@@ -152,18 +154,19 @@ public class BinaryRangeAggregatorTests extends ESTestCase {
}
@Override
- public void setDocument(int docID) {
- // no-op
+ public boolean advanceExact(int docID) {
+ i = 0;
+ return true;
}
@Override
- public int count() {
+ public int docValueCount() {
return ords.length;
}
@Override
- public BytesRef valueAt(int index) {
- return terms[(int) ords[index]];
+ public BytesRef nextValue() {
+ return terms[(int) ords[i++]];
}
}