Skip to content

Commit 1afafb3

Browse files
authored
Fix disable auto-creation of indices in the AnalyticsEventEmitter (#96001) (#96005)
The previous fix (#95890) that relied on an alias couldn't work since we're not using an explicit alias to index documents. We don't have any test that checks if the events are correctly indexed so I had to manually check this change. I also had to use 8.8 since the feature is in broken state in main due to #95917. I am opening this PR as a quick fix for 8.8.x and will open another one to add explicit tests for the indexation.
1 parent 5619110 commit 1afafb3

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

x-pack/plugin/core/src/main/resources/org/elasticsearch/xpack/entsearch/analytics/behavioral_analytics-events-template.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"behavioral_analytics-events-settings",
99
"behavioral_analytics-events-mappings"
1010
],
11+
"allow_auto_create": false,
1112
"_meta": {
1213
"description": "Built-in template applied by default to behavioral analytics event data streams.",
1314
"managed": true

x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/ingest/AnalyticsEventEmitter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ private IndexRequest createIndexRequest(AnalyticsEvent event) throws IOException
108108

109109
try (XContentBuilder builder = JsonXContent.contentBuilder()) {
110110
return client.prepareIndex(collection.getEventDataStream())
111-
// disable auto-creation of the underlying index
112-
.setRequireAlias(true)
113111
.setCreate(true)
114112
.setSource(event.toXContent(builder, ToXContent.EMPTY_PARAMS))
115113
.request();

0 commit comments

Comments
 (0)