|
71 | 71 | import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder; |
72 | 72 | import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregator; |
73 | 73 | import org.elasticsearch.search.aggregations.support.AggregationInspectionHelper; |
| 74 | +import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; |
74 | 75 | import org.elasticsearch.search.aggregations.support.ValueType; |
| 76 | +import org.elasticsearch.search.aggregations.support.ValuesSourceType; |
75 | 77 | import org.elasticsearch.search.lookup.LeafDocLookup; |
76 | 78 |
|
77 | 79 | import java.io.IOException; |
|
89 | 91 |
|
90 | 92 | import static java.util.Collections.emptyList; |
91 | 93 | import static java.util.Collections.singleton; |
| 94 | +import static java.util.Collections.singletonList; |
92 | 95 | import static org.elasticsearch.index.query.QueryBuilders.termQuery; |
93 | 96 | import static org.hamcrest.Matchers.equalTo; |
94 | 97 |
|
@@ -158,6 +161,17 @@ protected ScriptService getMockScriptService() { |
158 | 161 | return new ScriptService(Settings.EMPTY, engines, ScriptModule.CORE_CONTEXTS); |
159 | 162 | } |
160 | 163 |
|
| 164 | + @Override |
| 165 | + protected List<ValuesSourceType> getSupportedValuesSourceTypes() { |
| 166 | + return singletonList(CoreValuesSourceType.NUMERIC); |
| 167 | + } |
| 168 | + |
| 169 | + @Override |
| 170 | + protected AggregationBuilder createAggBuilderForTypeTest(MappedFieldType fieldType, String fieldName) { |
| 171 | + return new MaxAggregationBuilder("_name") |
| 172 | + .field(fieldName); |
| 173 | + } |
| 174 | + |
161 | 175 | public void testNoDocs() throws IOException { |
162 | 176 | testCase(new MatchAllDocsQuery(), iw -> { |
163 | 177 | // Intentionally not writing any docs |
|
0 commit comments