Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,6 @@ private NumberFieldMapper.NumberFieldType delegateFieldType() {
return delegateFieldType(defaultMetric);
}

@Override
public String familyTypeName() {
return NumberFieldMapper.NumberType.DOUBLE.typeName();
}

@Override
public String typeName() {
return CONTENT_TYPE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ public void testNoSubFieldsIterated() throws IOException {
public void testFieldCaps() throws IOException {
MapperService aggMetricMapperService = createMapperService(fieldMapping(this::minimalMapping));
MappedFieldType fieldType = aggMetricMapperService.fieldType("field");
assertThat(fieldType.familyTypeName(), equalTo("double"));
assertThat(fieldType.familyTypeName(), equalTo("aggregate_metric_double"));
assertTrue(fieldType.isSearchable());
assertTrue(fieldType.isAggregatable());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,58 @@ setup:
type: double
time_series_metric: gauge

- do:
indices.create:
index: test_aggregate_metric
body:
mappings:
properties:
metric:
type: aggregate_metric_double
metrics: [ min, max, value_count ]
default_metric: max

---
aggregate_metric on standard index:
- skip:
version: " - 8.4.99"
reason: aggregate_metric_double field caps changed in 8.5.0

- do:
field_caps:
index: test_aggregate_metric
fields: [ metric ]

- match: { fields.metric.aggregate_metric_double.searchable: true }
- match: { fields.metric.aggregate_metric_double.aggregatable: true }
- is_false: fields.metric.aggregate_metric_double.indices

---
aggregate_metric on standard index conflict with double:
- skip:
version: " - 8.4.99"
reason: aggregate_metric_double field caps changed in 8.5.0

- do:
indices.create:
index: test_double
body:
mappings:
properties:
metric:
type: double

- do:
field_caps:
index: [test_double, test_aggregate_metric]
fields: [ metric ]

- match: { fields.metric.aggregate_metric_double.searchable: true }
- match: { fields.metric.aggregate_metric_double.aggregatable: true }
- match: { fields.metric.aggregate_metric_double.indices: [ test_aggregate_metric ] }
- match: { fields.metric.double.searchable: true }
- match: { fields.metric.double.aggregatable: true }
- match: { fields.metric.double.indices: [ test_double ] }

---
# Test field_caps on a rollup index
Expand Down