@@ -21,6 +21,7 @@ import {
2121 SegmentedControlOption ,
2222} from '@mongodb-js/compass-components' ;
2323import { useConnectionInfo } from '@mongodb-js/compass-connections/provider' ;
24+ import semver from 'semver' ;
2425
2526import type { RootState } from '../../modules' ;
2627import { createSearchIndexOpened } from '../../modules/search-indexes' ;
@@ -62,6 +63,7 @@ type IndexesToolbarProps = {
6263 isRefreshing : boolean ;
6364 onRefreshIndexes : ( ) => void ;
6465 onIndexViewChanged : ( newView : IndexView ) => void ;
66+ serverVersion : string ;
6567 // connected:
6668 isReadonlyView : boolean ;
6769 isWritable : boolean ;
@@ -88,6 +90,7 @@ export const IndexesToolbar: React.FunctionComponent<IndexesToolbarProps> = ({
8890 isSearchIndexesSupported,
8991 onRefreshIndexes,
9092 onIndexViewChanged,
93+ serverVersion,
9194 readOnly, // preferences readOnly.
9295} ) => {
9396 const isSearchManagementActive = usePreference ( 'enableAtlasSearchIndexes' ) ;
@@ -188,16 +191,27 @@ export const IndexesToolbar: React.FunctionComponent<IndexesToolbarProps> = ({
188191 </ SegmentedControlOption >
189192 }
190193 >
191- < p >
192- Atlas Search index management in Compass is only available
193- for Atlas local deployments and clusters running MongoDB
194- 6.0.7 or newer.
195- </ p >
196- < p >
197- For clusters running an earlier version of MongoDB, you
198- can manage your Atlas Search indexes from the Atlas web
199- Ul, with the CLI, or with the Administration API.
200- </ p >
194+ { semver . gte ( serverVersion , '6.0.7' ) ? (
195+ < p >
196+ Unable to fetch search indexes. This can occur when your
197+ cluster does not support search indexes or the listing
198+ search indexes request failed.
199+ </ p >
200+ ) : (
201+ < >
202+ < p >
203+ Atlas Search index management in Compass is only
204+ available for Atlas local deployments and clusters
205+ running MongoDB 6.0.7 or newer.
206+ </ p >
207+ < p >
208+ For clusters running an earlier version of MongoDB,
209+ you can manage your Atlas Search indexes from the
210+ Atlas web Ul, with the CLI, or with the Administration
211+ API.
212+ </ p >
213+ </ >
214+ ) }
201215 </ Tooltip >
202216 ) }
203217 { isSearchIndexesSupported && (
0 commit comments