@@ -105,32 +105,6 @@ export const getIndicesViaResolve = async ({
105105 } ) ;
106106} ;
107107
108- /**
109- * Takes two MatchedItem[]s and returns a merged set, with the second set prrioritized over the first based on name
110- *
111- * @param matchedA
112- * @param matchedB
113- */
114-
115- export const dedupeMatchedItems = ( matchedA : MatchedItem [ ] , matchedB : MatchedItem [ ] ) => {
116- const mergedMatchedItems = matchedA . reduce ( ( col , item ) => {
117- col [ item . name ] = item ;
118- return col ;
119- } , { } as Record < string , MatchedItem > ) ;
120-
121- matchedB . reduce ( ( col , item ) => {
122- col [ item . name ] = item ;
123- return col ;
124- } , mergedMatchedItems ) ;
125-
126- return Object . values ( mergedMatchedItems ) . sort ( ( a , b ) => {
127- if ( a . name > b . name ) return 1 ;
128- if ( b . name > a . name ) return - 1 ;
129-
130- return 0 ;
131- } ) ;
132- } ;
133-
134108export async function getIndices ( {
135109 http,
136110 getIndexTags = ( ) => [ ] ,
@@ -147,7 +121,6 @@ export async function getIndices({
147121 dataSourceId ?: string ;
148122} ) : Promise < MatchedItem [ ] > {
149123 const pattern = rawPattern . trim ( ) ;
150- const isCCS = pattern . indexOf ( ':' ) !== - 1 ;
151124 const requests : Array < Promise < MatchedItem [ ] > > = [ ] ;
152125
153126 // Searching for `*:` fails for CCS environments. The search request
@@ -184,26 +157,8 @@ export async function getIndices({
184157 } ) ;
185158 requests . push ( promiseResolve ) ;
186159
187- if ( isCCS ) {
188- // CCS supports ±1 major version. We won't be able to expect resolve endpoint to exist until v9
189- const promiseSearch = getIndicesViaSearch ( {
190- getIndexTags,
191- pattern,
192- searchClient,
193- showAllIndices,
194- dataSourceId,
195- } ) . catch ( ( ) => [ ] ) ;
196- requests . push ( promiseSearch ) ;
197- }
198-
199160 const responses = await Promise . all ( requests ) ;
200-
201- if ( responses . length === 2 ) {
202- const [ resolveResponse , searchResponse ] = responses ;
203- return dedupeMatchedItems ( searchResponse , resolveResponse ) ;
204- } else {
205- return responses [ 0 ] ;
206- }
161+ return responses [ 0 ] ;
207162}
208163
209164export const responseToItemArray = (
0 commit comments