Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support non-keyword dimensions as routing fields in TSDB #105501

Merged
merged 64 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
7aa71c5
Fix test failure
kkrik-es Feb 1, 2024
bf946a9
Fix test failure
kkrik-es Feb 1, 2024
0fa5a7e
Merge branch 'elastic:main' into fix/103567
kkrik-es Feb 1, 2024
87cfbbd
Merge branch 'main' into fix/103567
kkrik-es Feb 2, 2024
a3a2ac0
Nest pass-through objects within objects
kkrik-es Feb 2, 2024
3dda19d
Merge remote-tracking branch 'origin/fix/103567' into fix/103567
kkrik-es Feb 2, 2024
beea734
Support numeric fields as pass-through dimensions
kkrik-es Feb 2, 2024
2e18f8b
Update docs/changelog/105073.yaml
kkrik-es Feb 2, 2024
cbb1368
Merge branch 'main' into fix/103567-2
kkrik-es Feb 5, 2024
cb94c8a
fix tests
kkrik-es Feb 5, 2024
af6e8a5
Merge remote-tracking branch 'origin/fix/103567-2' into fix/103567-2
kkrik-es Feb 5, 2024
61d37a7
fix tests
kkrik-es Feb 5, 2024
0ddecbd
refactor dimension property
kkrik-es Feb 5, 2024
fa065b0
fix yaml
kkrik-es Feb 5, 2024
c712893
add numeric to routing builder
kkrik-es Feb 5, 2024
03784f7
fix violation
kkrik-es Feb 5, 2024
5c23358
fix yaml versions
kkrik-es Feb 5, 2024
d73c472
handle all numeric values in dimension fields
kkrik-es Feb 6, 2024
86257db
Merge branch 'main' into fix/103567-2
kkrik-es Feb 12, 2024
e2887a0
use shardId in TSDB doc id
kkrik-es Feb 13, 2024
846649b
spotless fix
kkrik-es Feb 13, 2024
f464b6e
test fixes
kkrik-es Feb 13, 2024
7363869
Merge branch 'main' into fix/103567-2
kkrik-es Feb 13, 2024
605cdf3
index version guard
kkrik-es Feb 14, 2024
8f56346
test fix
kkrik-es Feb 14, 2024
93787f9
revert shardId changes
kkrik-es Feb 14, 2024
b098202
add routing id field mapper
kkrik-es Feb 14, 2024
0e67c67
Merge branch 'main' into fix/103567-3
kkrik-es Feb 14, 2024
916e7d5
Update docs/changelog/105501.yaml
kkrik-es Feb 14, 2024
7ea7feb
fix shrunk test
kkrik-es Feb 14, 2024
2cb890b
Merge remote-tracking branch 'origin/fix/103567-3' into fix/103567-3
kkrik-es Feb 14, 2024
6ab5a3f
use SortedDocValuesField
kkrik-es Feb 14, 2024
2f27478
fix tests
kkrik-es Feb 15, 2024
c13e0ff
delete unused yaml
kkrik-es Feb 15, 2024
1f18603
submit test fixes
kkrik-es Feb 19, 2024
a6d916e
Merge branch 'main' into fix/103567-3
kkrik-es Feb 19, 2024
72cd225
sync
kkrik-es Feb 19, 2024
30b4dbb
restrict id override to latest version
kkrik-es Feb 19, 2024
8cd5456
update painless path
kkrik-es Feb 19, 2024
302701b
test fix
kkrik-es Mar 4, 2024
b14e774
Merge branch 'main' into fix/103567-3
kkrik-es Mar 4, 2024
dc0a887
check for invalid id
kkrik-es Mar 4, 2024
f14721e
fix painless tests
kkrik-es Mar 4, 2024
c7a9ebc
restore bwc routing changes
kkrik-es Mar 4, 2024
4b1d532
add unittest
kkrik-es Mar 5, 2024
cd4fb92
refactor passthrough test
kkrik-es Mar 5, 2024
ebd631b
Merge branch 'main' into fix/103567-3
kkrik-es Mar 6, 2024
ed7a007
address comments
kkrik-es Mar 7, 2024
0823128
remove redundant variable
kkrik-es Mar 7, 2024
1ce6618
remove assert
kkrik-es Mar 7, 2024
1930c59
fix id test
kkrik-es Mar 7, 2024
5a0d8c9
fix painless
kkrik-es Mar 7, 2024
5d7ba13
skip storing routing field
kkrik-es Mar 7, 2024
d35603c
skip generating the id when available
kkrik-es Mar 7, 2024
5203068
skip assert on routing in TranslogWriter
kkrik-es Mar 7, 2024
4646c8c
skip id mismatch assert
kkrik-es Mar 7, 2024
7daa041
Merge branch 'main' into fix/103567-3
kkrik-es Mar 13, 2024
513e426
changelog update
kkrik-es Mar 13, 2024
bd8f7b9
revert redundant changes
kkrik-es Mar 13, 2024
ada4293
remove supportsDimension
kkrik-es Mar 20, 2024
3a5d234
spotless
kkrik-es Mar 20, 2024
6f56b4d
rename var for forcing dimension
kkrik-es Mar 20, 2024
14b162d
small refactor
kkrik-es Mar 20, 2024
d9eb129
small refactor
kkrik-es Mar 20, 2024
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
5 changes: 5 additions & 0 deletions docs/changelog/105501.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 105501
summary: Support non-keyword dimensions as routing fields in TSDB
area: TSDB
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public void testInvalidTsdbTemplatesNoTimeSeriesDimensionAttribute() throws Exce
assertThat(
e.getCause().getCause().getMessage(),
equalTo(
"All fields that match routing_path must be keywords with [time_series_dimension: true] "
"All fields that match routing_path must be configured with [time_series_dimension: true] "
+ "or flattened fields with a list of dimensions in [time_series_dimensions] and "
+ "without the [script] parameter. [metricset] was not a dimension."
)
Expand Down Expand Up @@ -289,7 +289,7 @@ public void testInvalidTsdbTemplatesNoTimeSeriesDimensionAttribute() throws Exce
}
}

public void testInvalidTsdbTemplatesNoKeywordFieldType() throws Exception {
public void testTsdbTemplatesNoKeywordFieldType() throws Exception {
var mappingTemplate = """
{
"_doc":{
Expand All @@ -315,18 +315,7 @@ public void testInvalidTsdbTemplatesNoKeywordFieldType() throws Exception {
.dataStreamTemplate(new ComposableIndexTemplate.DataStreamTemplate(false, false))
.build()
);
Exception e = expectThrows(
IllegalArgumentException.class,
() -> client().execute(TransportPutComposableIndexTemplateAction.TYPE, request).actionGet()
);
assertThat(
e.getCause().getCause().getMessage(),
equalTo(
"All fields that match routing_path must be keywords with [time_series_dimension: true] "
+ "or flattened fields with a list of dimensions in [time_series_dimensions] and "
+ "without the [script] parameter. [metricset] was [long]."
)
);
client().execute(TransportPutComposableIndexTemplateAction.TYPE, request).actionGet();
}

public void testInvalidTsdbTemplatesMissingSettings() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ public class TSDBPassthroughIndexingIT extends ESSingleNodeTestCase {
public static final String MAPPING_TEMPLATE = """
{
"_doc":{
"dynamic_templates": [
{
"strings_as_ip": {
"match_mapping_type": "string",
"match": "*ip",
"mapping": {
"type": "ip"
}
}
}
],
"properties": {
"@timestamp" : {
"type": "date"
Expand Down Expand Up @@ -87,6 +98,8 @@ public class TSDBPassthroughIndexingIT extends ESSingleNodeTestCase {
"@timestamp": "$time",
"attributes": {
"metricset": "pod",
"number.long": $number1,
"number.double": $number2,
"pod": {
"name": "$name",
"uid": "$uid",
Expand All @@ -102,6 +115,15 @@ public class TSDBPassthroughIndexingIT extends ESSingleNodeTestCase {
}
""";

private static String getRandomDoc(Instant time) {
return DOC.replace("$time", formatInstant(time))
.replace("$uid", randomUUID())
.replace("$name", randomAlphaOfLength(4))
.replace("$number1", Long.toString(randomLong()))
.replace("$number2", Double.toString(randomDouble()))
.replace("$ip", InetAddresses.toAddrString(randomIp(randomBoolean())));
}

@Override
protected Collection<Class<? extends Plugin>> getPlugins() {
return List.of(DataStreamsPlugin.class, InternalSettingsPlugin.class);
Expand Down Expand Up @@ -137,13 +159,7 @@ public void testIndexingGettingAndSearching() throws Exception {
Instant time = Instant.now();
for (int i = 0; i < indexingIters; i++) {
var indexRequest = new IndexRequest("k8s").opType(DocWriteRequest.OpType.CREATE);
indexRequest.source(
DOC.replace("$time", formatInstant(time))
.replace("$uid", randomUUID())
.replace("$name", randomAlphaOfLength(4))
.replace("$ip", InetAddresses.toAddrString(randomIp(randomBoolean()))),
XContentType.JSON
);
indexRequest.source(getRandomDoc(time), XContentType.JSON);
var indexResponse = client().index(indexRequest).actionGet();
index = indexResponse.getIndex();
String id = indexResponse.getId();
Expand Down Expand Up @@ -176,14 +192,24 @@ public void testIndexingGettingAndSearching() throws Exception {
);
@SuppressWarnings("unchecked")
var attributes = (Map<String, Map<?, ?>>) ObjectPath.eval("properties.attributes.properties", mapping);
assertMap(attributes.get("pod.ip"), matchesMap().entry("type", "keyword").entry("time_series_dimension", true));
assertMap(attributes.get("number.long"), matchesMap().entry("type", "long").entry("time_series_dimension", true));
assertMap(attributes.get("number.double"), matchesMap().entry("type", "float").entry("time_series_dimension", true));
assertMap(attributes.get("pod.ip"), matchesMap().entry("type", "ip").entry("time_series_dimension", true));
assertMap(attributes.get("pod.uid"), matchesMap().entry("type", "keyword").entry("time_series_dimension", true));
assertMap(attributes.get("pod.name"), matchesMap().entry("type", "keyword").entry("time_series_dimension", true));
// alias field mappers:
assertMap(
ObjectPath.eval("properties.metricset", mapping),
matchesMap().entry("type", "alias").entry("path", "attributes.metricset")
);
assertMap(
martijnvg marked this conversation as resolved.
Show resolved Hide resolved
ObjectPath.eval("properties.number.properties.long", mapping),
matchesMap().entry("type", "alias").entry("path", "attributes.number.long")
);
assertMap(
ObjectPath.eval("properties.number.properties.double", mapping),
matchesMap().entry("type", "alias").entry("path", "attributes.number.double")
);
assertMap(
ObjectPath.eval("properties.pod.properties", mapping),
matchesMap().extraOk().entry("name", matchesMap().entry("type", "alias").entry("path", "attributes.pod.name"))
Expand Down Expand Up @@ -220,13 +246,7 @@ public void testIndexingGettingAndSearchingShrunkIndex() throws Exception {
var bulkRequest = new BulkRequest(dataStreamName);
for (int i = 0; i < numBulkItems; i++) {
var indexRequest = new IndexRequest(dataStreamName).opType(DocWriteRequest.OpType.CREATE);
indexRequest.source(
DOC.replace("$time", formatInstant(time))
.replace("$uid", randomUUID())
.replace("$name", randomAlphaOfLength(4))
.replace("$ip", InetAddresses.toAddrString(randomIp(randomBoolean()))),
XContentType.JSON
);
indexRequest.source(getRandomDoc(time), XContentType.JSON);
bulkRequest.add(indexRequest);
time = time.plusMillis(1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ dynamic templates:
refresh: true
body:
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
- '{ "@timestamp": "2023-09-01T13:03:08.138Z", "data": "10", "attributes.dim1": "A", "attributes.dim2": "1", "attributes.another.dim1": "C", "attributes.another.dim2": "10" }'
- '{ "@timestamp": "2023-09-01T13:03:08.138Z", "data": "10", "attributes.dim1": "A", "attributes.dim2": "1", "attributes.another.dim1": "C", "attributes.another.dim2": "10.5" }'
martijnvg marked this conversation as resolved.
Show resolved Hide resolved
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
- '{ "@timestamp": "2023-09-01T13:03:09.138Z", "data": "20", "attributes.dim1": "A", "attributes.dim2": "1", "attributes.another.dim1": "C", "attributes.another.dim2": "10" }'
- '{ "@timestamp": "2023-09-01T13:03:09.138Z", "data": "20", "attributes.dim1": "A", "attributes.dim2": "1", "attributes.another.dim1": "C", "attributes.another.dim2": "10.5" }'
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
- '{ "@timestamp": "2023-09-01T13:03:10.138Z", "data": "30", "attributes.dim1": "B", "attributes.dim2": "2", "attributes.another.dim1": "D", "attributes.another.dim2": "20" }'
- '{ "@timestamp": "2023-09-01T13:03:10.138Z", "data": "30", "attributes.dim1": "B", "attributes.dim2": "2", "attributes.another.dim1": "D", "attributes.another.dim2": "20.5" }'
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
- '{ "@timestamp": "2023-09-01T13:03:10.238Z", "data": "40", "attributes.dim1": "B", "attributes.dim2": "2", "attributes.another.dim1": "D", "attributes.another.dim2": "20" }'
- '{ "@timestamp": "2023-09-01T13:03:10.238Z", "data": "40", "attributes.dim1": "B", "attributes.dim2": "2", "attributes.another.dim1": "D", "attributes.another.dim2": "20.5" }'

- do:
search:
Expand All @@ -263,7 +263,7 @@ dynamic templates:
field: _tsid

- length: { aggregations.filterA.tsids.buckets: 1 }
- match: { aggregations.filterA.tsids.buckets.0.key: "MD2HE8yse1ZklY-p0-bRcC8gYpiK8yYWLhfZ18WLDvTuBX1YJX1Ll7UMNJqYNES5Eg" }
- match: { aggregations.filterA.tsids.buckets.0.key: "MD2HE8yse1ZklY-p0-bRcC8gYpiKqVppKhfZ18WLDvTuNPo7EnyZdkhvafL006Xf2Q" }
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }

- do:
Expand All @@ -282,7 +282,7 @@ dynamic templates:
field: _tsid

- length: { aggregations.filterA.tsids.buckets: 1 }
- match: { aggregations.filterA.tsids.buckets.0.key: "MD2HE8yse1ZklY-p0-bRcC8gYpiK8yYWLhfZ18WLDvTuBX1YJX1Ll7UMNJqYNES5Eg" }
- match: { aggregations.filterA.tsids.buckets.0.key: "MD2HE8yse1ZklY-p0-bRcC8gYpiKqVppKhfZ18WLDvTuNPo7EnyZdkhvafL006Xf2Q" }
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }

- do:
Expand All @@ -301,7 +301,7 @@ dynamic templates:
field: _tsid

- length: { aggregations.filterA.tsids.buckets: 1 }
- match: { aggregations.filterA.tsids.buckets.0.key: "MD2HE8yse1ZklY-p0-bRcC8gYpiK8yYWLhfZ18WLDvTuBX1YJX1Ll7UMNJqYNES5Eg" }
- match: { aggregations.filterA.tsids.buckets.0.key: "MD2HE8yse1ZklY-p0-bRcC8gYpiKqVppKhfZ18WLDvTuNPo7EnyZdkhvafL006Xf2Q" }
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }

- do:
Expand All @@ -313,14 +313,14 @@ dynamic templates:
filterA:
filter:
term:
another.dim2: 10
another.dim2: 10.5
aggs:
tsids:
terms:
field: _tsid

- length: { aggregations.filterA.tsids.buckets: 1 }
- match: { aggregations.filterA.tsids.buckets.0.key: "MD2HE8yse1ZklY-p0-bRcC8gYpiK8yYWLhfZ18WLDvTuBX1YJX1Ll7UMNJqYNES5Eg" }
- match: { aggregations.filterA.tsids.buckets.0.key: "MD2HE8yse1ZklY-p0-bRcC8gYpiKqVppKhfZ18WLDvTuNPo7EnyZdkhvafL006Xf2Q" }
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }

---
Expand Down Expand Up @@ -466,13 +466,13 @@ dynamic templates with nesting:
refresh: true
body:
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
- '{ "@timestamp": "2023-09-01T13:03:08.138Z","data": "10", "resource.attributes.dim1": "A", "resource.attributes.another.dim1": "1", "attributes.dim2": "C", "attributes.another.dim2": "10" }'
- '{ "@timestamp": "2023-09-01T13:03:08.138Z","data": "10", "resource.attributes.dim1": "A", "resource.attributes.another.dim1": "1", "attributes.dim2": "C", "attributes.another.dim2": "10.5" }'
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
- '{ "@timestamp": "2023-09-01T13:03:09.138Z","data": "20", "resource.attributes.dim1": "A", "resource.attributes.another.dim1": "1", "attributes.dim2": "C", "attributes.another.dim2": "10" }'
- '{ "@timestamp": "2023-09-01T13:03:09.138Z","data": "20", "resource.attributes.dim1": "A", "resource.attributes.another.dim1": "1", "attributes.dim2": "C", "attributes.another.dim2": "10.5" }'
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
- '{ "@timestamp": "2023-09-01T13:03:10.138Z","data": "30", "resource.attributes.dim1": "B", "resource.attributes.another.dim1": "2", "attributes.dim2": "D", "attributes.another.dim2": "20" }'
- '{ "@timestamp": "2023-09-01T13:03:10.138Z","data": "30", "resource.attributes.dim1": "B", "resource.attributes.another.dim1": "2", "attributes.dim2": "D", "attributes.another.dim2": "20.5" }'
- '{ "create": { "dynamic_templates": { "data": "counter_metric" } } }'
- '{ "@timestamp": "2023-09-01T13:03:10.238Z","data": "40", "resource.attributes.dim1": "B", "resource.attributes.another.dim1": "2", "attributes.dim2": "D", "attributes.another.dim2": "20" }'
- '{ "@timestamp": "2023-09-01T13:03:10.238Z","data": "40", "resource.attributes.dim1": "B", "resource.attributes.another.dim1": "2", "attributes.dim2": "D", "attributes.another.dim2": "20.5" }'

- do:
search:
Expand All @@ -498,7 +498,7 @@ dynamic templates with nesting:
field: _tsid

- length: { aggregations.filterA.tsids.buckets: 1 }
- match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK7zJhYuIGKYiosO9O4X2dfFtp-JEbk39FSSMEq_vwX7uw" }
- match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK6pWmkqIGKYiosO9O4X2dfFL8p_4TfsFAUUYYv9EqSmEQ" }
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }

- do:
Expand All @@ -517,7 +517,7 @@ dynamic templates with nesting:
field: _tsid

- length: { aggregations.filterA.tsids.buckets: 1 }
- match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK7zJhYuIGKYiosO9O4X2dfFtp-JEbk39FSSMEq_vwX7uw" }
- match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK6pWmkqIGKYiosO9O4X2dfFL8p_4TfsFAUUYYv9EqSmEQ" }
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }

- do:
Expand All @@ -536,7 +536,7 @@ dynamic templates with nesting:
field: _tsid

- length: { aggregations.filterA.tsids.buckets: 1 }
- match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK7zJhYuIGKYiosO9O4X2dfFtp-JEbk39FSSMEq_vwX7uw" }
- match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK6pWmkqIGKYiosO9O4X2dfFL8p_4TfsFAUUYYv9EqSmEQ" }
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }

- do:
Expand All @@ -548,14 +548,14 @@ dynamic templates with nesting:
filterA:
filter:
term:
another.dim2: 10
another.dim2: 10.5
aggs:
tsids:
terms:
field: _tsid

- length: { aggregations.filterA.tsids.buckets: 1 }
- match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK7zJhYuIGKYiosO9O4X2dfFtp-JEbk39FSSMEq_vwX7uw" }
- match: { aggregations.filterA.tsids.buckets.0.key: "MK0AtuFZowY4QPzoYEAZNK6pWmkqIGKYiosO9O4X2dfFL8p_4TfsFAUUYYv9EqSmEQ" }
- match: { aggregations.filterA.tsids.buckets.0.doc_count: 2 }

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ missing routing path field:
---
missing dimension on routing path field:
- skip:
version: " - 8.7.99"
reason: error message changed in 8.8.0
version: " - 8.13.99"
reason: error message changed in 8.14.0

- do:
catch: '/All fields that match routing_path must be keywords with \[time_series_dimension: true\] or flattened fields with a list of dimensions in \[time_series_dimensions\] and without the \[script\] parameter. \[tag\] was not a dimension./'
catch: '/All fields that match routing_path must be configured with \[time_series_dimension: true\] or flattened fields with a list of dimensions in \[time_series_dimensions\] and without the \[script\] parameter. \[tag\] was not a dimension./'
indices.create:
index: test
body:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ top level wildcard dim object:
---
exact match object type:
- skip:
version: " - 8.7.99"
reason: routing_path error message updated in 8.8.0
version: " - 8.13.99"
reason: routing_path error message updated in 8.14.0

- do:
catch: '/All fields that match routing_path must be keywords with \[time_series_dimension: true\] or flattened fields with a list of dimensions in \[time_series_dimensions\] and without the \[script\] parameter. \[dim\] was \[object\]./'
catch: '/All fields that match routing_path must be configured with \[time_series_dimension: true\] or flattened fields with a list of dimensions in \[time_series_dimensions\] and without the \[script\] parameter. \[dim\] was \[object\]./'
indices.create:
index: tsdb_index
body:
Expand Down Expand Up @@ -154,11 +154,11 @@ exact match object type:
---
non keyword matches routing_path:
- skip:
version: " - 8.7.99"
reason: routing_path error message updated in 8.8.0
version: " - 8.13.99"
reason: routing_path error message updated in 8.14.0

- do:
catch: '/All fields that match routing_path must be keywords with \[time_series_dimension: true\] or flattened fields with a list of dimensions in \[time_series_dimensions\] and without the \[script\] parameter. \[@timestamp\] was \[date\]./'
catch: '/All fields that match routing_path must be configured with \[time_series_dimension: true\] or flattened fields with a list of dimensions in \[time_series_dimensions\] and without the \[script\] parameter. \[@timestamp\] was not a dimension./'
indices.create:
index: test_index
body:
Expand Down Expand Up @@ -273,7 +273,7 @@ runtime field matching routing path:
body:
- '{"index": {}}'
- '{"@timestamp": "2021-04-28T18:50:04.467Z", "dim_kw": "dim", "dim": {"foo": "a"}, "extra_field": 100}'
- match: {items.0.index.error.reason: "All fields that match routing_path must be keywords with [time_series_dimension: true] or flattened fields with a list of dimensions in [time_series_dimensions] and without the [script] parameter. [dim.foo] was a runtime [keyword]."}
- match: {items.0.index.error.reason: "All fields that match routing_path must be configured with [time_series_dimension: true] or flattened fields with a list of dimensions in [time_series_dimensions] and without the [script] parameter. [dim.foo] was a runtime [keyword]."}

---
"dynamic: false matches routing_path":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected final LeafFactory leafFactory(SearchExecutionContext context) {
public void validateMatchedRoutingPath(final String routingPath) {
throw new IllegalArgumentException(
"All fields that match routing_path "
+ "must be keywords with [time_series_dimension: true] "
+ "must be configured with [time_series_dimension: true] "
+ "or flattened fields with a list of dimensions in [time_series_dimensions] "
+ "and without the [script] parameter. ["
+ name()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void validate(IndexSettings settings, boolean checkLimits) {
// object type is not allowed in the routing paths
if (path.equals(objectName)) {
throw new IllegalArgumentException(
"All fields that match routing_path must be keywords with [time_series_dimension: true] "
"All fields that match routing_path must be configured with [time_series_dimension: true] "
+ "or flattened fields with a list of dimensions in [time_series_dimensions] "
+ "and without the [script] parameter. ["
+ objectName
Expand Down
Loading