@@ -140,32 +140,29 @@ object DocumentLevelMonitorRunner : MonitorRunner() {
140
140
}
141
141
}
142
142
143
- indices.forEach { indexName ->
144
- // Prepare lastRunContext for each index
145
- val indexLastRunContext = lastRunContext.getOrPut(indexName) {
146
- val isIndexCreatedRecently = createdRecently(
147
- monitor,
148
- periodStart,
149
- periodEnd,
150
- monitorCtx.clusterService!! .state().metadata.index(indexName)
151
- )
152
- val updatedIndexName = indexName.replace(" *" , " _" )
153
- val conflictingFields = monitorCtx.docLevelMonitorQueries!! .getAllConflictingFields(
154
- monitorCtx.clusterService!! .state(),
155
- concreteIndices
156
- )
143
+ docLevelMonitorInput.indices.forEach { indexName ->
144
+ val concreteIndices = IndexUtils .resolveAllIndices(
145
+ listOf (indexName),
146
+ monitorCtx.clusterService!! ,
147
+ monitorCtx.indexNameExpressionResolver!!
148
+ )
149
+ val updatedIndexName = indexName.replace(" *" , " _" )
150
+ val conflictingFields = monitorCtx.docLevelMonitorQueries!! .getAllConflictingFields(
151
+ monitorCtx.clusterService!! .state(),
152
+ concreteIndices
153
+ )
157
154
158
- concreteIndices.forEach { concreteIndexName ->
159
- // Prepare lastRunContext for each index
160
- val indexLastRunContext = lastRunContext.getOrPut(concreteIndexName) {
161
- val isIndexCreatedRecently = createdRecently(
162
- monitor,
163
- periodStart,
164
- periodEnd,
165
- monitorCtx.clusterService!! .state().metadata.index(concreteIndexName)
166
- )
167
- MonitorMetadataService .createRunContextForIndex(concreteIndexName, isIndexCreatedRecently)
168
- }
155
+ concreteIndices.forEach { concreteIndexName ->
156
+ // Prepare lastRunContext for each index
157
+ val indexLastRunContext = lastRunContext.getOrPut(concreteIndexName) {
158
+ val isIndexCreatedRecently = createdRecently(
159
+ monitor,
160
+ periodStart,
161
+ periodEnd,
162
+ monitorCtx.clusterService!! .state().metadata.index(concreteIndexName)
163
+ )
164
+ MonitorMetadataService .createRunContextForIndex(concreteIndexName, isIndexCreatedRecently)
165
+ }
169
166
170
167
// Prepare updatedLastRunContext for each index
171
168
val indexUpdatedRunContext = updateLastRunContext(
@@ -189,15 +186,14 @@ object DocumentLevelMonitorRunner : MonitorRunner() {
189
186
// Prepare DocumentExecutionContext for each index
190
187
val docExecutionContext = DocumentExecutionContext (queries, indexLastRunContext, indexUpdatedRunContext)
191
188
192
- val matchingDocs = getMatchingDocs(
193
- monitor,
194
- monitorCtx,
195
- docExecutionContext,
196
- indexName,
197
- updatedIndexName,
198
- concreteIndexName,
199
- conflictingFields.toList()
200
- )
189
+ val matchingDocs = getMatchingDocs(
190
+ monitor,
191
+ monitorCtx,
192
+ docExecutionContext,
193
+ updatedIndexName,
194
+ concreteIndexName,
195
+ conflictingFields.toList()
196
+ )
201
197
202
198
if (matchingDocs.isNotEmpty()) {
203
199
val matchedQueriesForDocs = getMatchedQueries(
0 commit comments