File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
src/plugins/data/public/query/query_string/dataset_service/lib Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1+ fix :
2+ - Dedupe index names for data selection ([#10850](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/10850))
Original file line number Diff line number Diff line change @@ -231,15 +231,17 @@ const fetchIndices = async (dataStructure: DataStructure): Promise<string[]> =>
231231 return [ ] ;
232232 }
233233
234- return rawResponse . aggregations . indices . buckets . map ( ( bucket : { key : string } ) => {
234+ const uniqueResponses = new Set < string > ( ) ;
235+ rawResponse . aggregations . indices . buckets . forEach ( ( bucket : { key : string } ) => {
235236 const key = bucket . key ;
236237 // Note: Index names cannot contain ':' or '::' in OpenSearch, so these delimiters
237238 // are guaranteed not to be part of the regular format of index name
238239 const parts = key . split ( DELIMITER ) ;
239240 const lastPart = parts [ parts . length - 1 ] || key ;
240241 // extract index name or return original key if pattern doesn't match
241- return lastPart . split ( ':' ) [ 0 ] || key ;
242+ uniqueResponses . add ( lastPart . split ( ':' ) [ 0 ] || key ) ;
242243 } ) ;
244+ return Array . from ( uniqueResponses ) ;
243245 } ;
244246
245247 return search
You can’t perform that action at this time.
0 commit comments