|
@@ -97,10 +97,15 @@ public class LogsIndexModeCustomSettingsIT extends LogsIndexModeRestTestIT {
|
|
|
assertThat(type, equalTo("date"));
|
|
|
}
|
|
|
|
|
|
- public void testConfigureStoredSource() throws IOException {
|
|
|
+ public void testConfigureStoredSourceBeforeIndexCreation() throws IOException {
|
|
|
var storedSourceMapping = """
|
|
|
{
|
|
|
"template": {
|
|
|
+ "settings": {
|
|
|
+ "index": {
|
|
|
+ "mode": "logsdb"
|
|
|
+ }
|
|
|
+ },
|
|
|
"mappings": {
|
|
|
"_source": {
|
|
|
"mode": "stored"
|
|
@@ -112,9 +117,9 @@ public class LogsIndexModeCustomSettingsIT extends LogsIndexModeRestTestIT {
|
|
|
Exception e = assertThrows(ResponseException.class, () -> putComponentTemplate(client, "logs@custom", storedSourceMapping));
|
|
|
assertThat(
|
|
|
e.getMessage(),
|
|
|
- containsString("updating component template [logs@custom] results in invalid composable template [logs]")
|
|
|
+ containsString("Failed to parse mapping: Indices with with index mode [logsdb] only support synthetic source")
|
|
|
);
|
|
|
- assertThat(e.getMessage(), containsString("Indices with with index mode [logsdb] only support synthetic source"));
|
|
|
+ assertThat(e.getMessage(), containsString("mapper_parsing_exception"));
|
|
|
|
|
|
assertOK(createDataStream(client, "logs-custom-dev"));
|
|
|
|
|
@@ -123,6 +128,23 @@ public class LogsIndexModeCustomSettingsIT extends LogsIndexModeRestTestIT {
|
|
|
assertThat(sourceMode, equalTo("synthetic"));
|
|
|
}
|
|
|
|
|
|
+ public void testConfigureStoredSourceWhenIndexIsCreated() throws IOException {
|
|
|
+ var storedSourceMapping = """
|
|
|
+ {
|
|
|
+ "template": {
|
|
|
+ "mappings": {
|
|
|
+ "_source": {
|
|
|
+ "mode": "stored"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }""";
|
|
|
+
|
|
|
+ assertOK(putComponentTemplate(client, "logs@custom", storedSourceMapping));
|
|
|
+ ResponseException e = expectThrows(ResponseException.class, () -> createDataStream(client, "logs-custom-dev"));
|
|
|
+ assertThat(e.getMessage(), containsString("Indices with with index mode [logsdb] only support synthetic source"));
|
|
|
+ }
|
|
|
+
|
|
|
public void testOverrideIndexCodec() throws IOException {
|
|
|
var indexCodecOverrideTemplate = """
|
|
|
{
|