[Enterprise Search][Search Application]Modify indices page warning and remove conflict when all indices are unavailable (#159147)

## Summary
When all the indices are deleted, add warning in Search application and should not show conflict in Schema page


### Screen Recording

cff68550-9410-4316-b7ac-b96fd1daa570
This commit is contained in:
Saarika Bhasi 2023-06-07 15:46:57 -04:00 committed by GitHub
parent 0e12300945
commit cb09e8c448
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 18 deletions

View file

@ -46,6 +46,8 @@ export const EngineIndices: React.FC = () => {
if (!engineData) return null; if (!engineData) return null;
const { indices } = engineData; const { indices } = engineData;
const hasAllUnreachableIndices = indices.every(({ health }) => health === 'unknown');
const hasUnknownIndices = indices.some(({ health }) => health === 'unknown'); const hasUnknownIndices = indices.some(({ health }) => health === 'unknown');
const removeIndexAction: EuiTableActionsColumnType<EnterpriseSearchEngineIndex>['actions'][0] = { const removeIndexAction: EuiTableActionsColumnType<EnterpriseSearchEngineIndex>['actions'][0] = {
@ -174,23 +176,50 @@ export const EngineIndices: React.FC = () => {
]; ];
return ( return (
<> <>
{hasUnknownIndices && ( {(hasAllUnreachableIndices || hasUnknownIndices) && (
<> <>
<EuiCallOut <EuiCallOut
color="warning" color="warning"
iconType="warning" iconType="warning"
title={i18n.translate( title={
'xpack.enterpriseSearch.content.engine.indices.unknownIndicesCallout.title', hasAllUnreachableIndices ? (
{ defaultMessage: 'Some of your indices are unavailable.' } <>
)} {i18n.translate(
'xpack.enterpriseSearch.content.engine.indices.allUnknownIndicesCallout.title',
{ defaultMessage: 'All of your indices are unavailable.' }
)}
</>
) : (
<>
{i18n.translate(
'xpack.enterpriseSearch.content.engine.indices.someUnknownIndicesCallout.title',
{ defaultMessage: 'Some of your indices are unavailable.' }
)}
</>
)
}
> >
<p> <p>
{i18n.translate( {hasAllUnreachableIndices ? (
'xpack.enterpriseSearch.content.engine.indices.unknownIndicesCallout.description', <>
{ {i18n.translate(
defaultMessage: 'xpack.enterpriseSearch.content.engine.indices.allUnknownIndicesCallout.description',
'Some data might be unreachable from this search application. Check for any pending operations or errors on affected indices, or remove indices that should no longer be used by this search application.', {
} defaultMessage:
'Your search application has no reachable indices. Add some indices and check for any pending operations or errors on affected indices, or remove indices that should no longer be used by this search application.',
}
)}
</>
) : (
<>
{i18n.translate(
'xpack.enterpriseSearch.content.engine.indices.someUnknownIndicesCallout.description',
{
defaultMessage:
'Some data might be unreachable from this search application. Check for any pending operations or errors on affected indices, or remove indices that should no longer be used by this search application.',
}
)}
</>
)} )}
</p> </p>
</EuiCallOut> </EuiCallOut>

View file

@ -21,12 +21,24 @@ export const fetchEngineFieldCapabilities = async (
engine: EnterpriseSearchEngine engine: EnterpriseSearchEngine
): Promise<EnterpriseSearchEngineFieldCapabilities> => { ): Promise<EnterpriseSearchEngineFieldCapabilities> => {
const { name, updated_at_millis, indices } = engine; const { name, updated_at_millis, indices } = engine;
const availableIndicesList = await availableIndices(client, indices);
if (!availableIndicesList.length) {
return {
fields: [],
name,
updated_at_millis,
};
}
const fieldCapabilities = await client.asCurrentUser.fieldCaps({ const fieldCapabilities = await client.asCurrentUser.fieldCaps({
fields: '*', fields: '*',
filters: '-metadata', filters: '-metadata',
include_unmapped: true, include_unmapped: true,
index: await availableIndices(client, indices), index: availableIndicesList,
}); });
const fields = parseFieldsCapabilities(fieldCapabilities); const fields = parseFieldsCapabilities(fieldCapabilities);
return { return {
fields, fields,

View file

@ -12932,8 +12932,6 @@
"xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.text": "Oui, retirer cet index", "xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.text": "Oui, retirer cet index",
"xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.title": "Supprimer cet index de l'application de recherche", "xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.title": "Supprimer cet index de l'application de recherche",
"xpack.enterpriseSearch.content.engine.indices.searchPlaceholder": "Filtrer les index", "xpack.enterpriseSearch.content.engine.indices.searchPlaceholder": "Filtrer les index",
"xpack.enterpriseSearch.content.engine.indices.unknownIndicesCallout.description": "Certaines données peuvent être inaccessibles à partir de cette application de recherche. Recherchez les opérations en attente ou les erreurs sur les index concernés, ou supprimez les index qui ne doivent plus être utilisés par cette application de recherche.",
"xpack.enterpriseSearch.content.engine.indices.unknownIndicesCallout.title": "Certains de vos index ne sont pas disponibles.",
"xpack.enterpriseSearch.content.engine.indicesSelect.docsLabel": "Documents :", "xpack.enterpriseSearch.content.engine.indicesSelect.docsLabel": "Documents :",
"xpack.enterpriseSearch.content.engine.schema.field_indices.columnTitle": "Dans tous les index ?", "xpack.enterpriseSearch.content.engine.schema.field_indices.columnTitle": "Dans tous les index ?",
"xpack.enterpriseSearch.content.engine.schema.field_indices.moreInfo": "Plus d'infos", "xpack.enterpriseSearch.content.engine.schema.field_indices.moreInfo": "Plus d'infos",

View file

@ -12931,8 +12931,6 @@
"xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.text": "はい。このインデックスを削除します", "xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.text": "はい。このインデックスを削除します",
"xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.title": "このインデックスを検索アプリケーションから削除", "xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.title": "このインデックスを検索アプリケーションから削除",
"xpack.enterpriseSearch.content.engine.indices.searchPlaceholder": "インデックスのフィルター", "xpack.enterpriseSearch.content.engine.indices.searchPlaceholder": "インデックスのフィルター",
"xpack.enterpriseSearch.content.engine.indices.unknownIndicesCallout.description": "この検索アプリケーションからは一部のデータに接続できない場合があります。影響を受けるインデックスで保留中の処理またはエラーがあるかどうかを確認するか、この検索アプリケーションで使用されないインデックスを削除してください。",
"xpack.enterpriseSearch.content.engine.indices.unknownIndicesCallout.title": "一部のインデックスが使用できません。",
"xpack.enterpriseSearch.content.engine.indicesSelect.docsLabel": "ドキュメント:", "xpack.enterpriseSearch.content.engine.indicesSelect.docsLabel": "ドキュメント:",
"xpack.enterpriseSearch.content.engine.schema.field_indices.columnTitle": "すべてのインデックスにありますか?", "xpack.enterpriseSearch.content.engine.schema.field_indices.columnTitle": "すべてのインデックスにありますか?",
"xpack.enterpriseSearch.content.engine.schema.field_indices.moreInfo": "詳細", "xpack.enterpriseSearch.content.engine.schema.field_indices.moreInfo": "詳細",

View file

@ -12931,8 +12931,6 @@
"xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.text": "是,移除此索引", "xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.text": "是,移除此索引",
"xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.title": "从搜索应用程序中移除此索引", "xpack.enterpriseSearch.content.engine.indices.removeIndexConfirm.title": "从搜索应用程序中移除此索引",
"xpack.enterpriseSearch.content.engine.indices.searchPlaceholder": "筛选索引", "xpack.enterpriseSearch.content.engine.indices.searchPlaceholder": "筛选索引",
"xpack.enterpriseSearch.content.engine.indices.unknownIndicesCallout.description": "可能无法从此搜索应用程序访问某些数据。在受影响的索引上检查任何待处理操作或错误,或移除应不再被此搜索应用程序使用的索引。",
"xpack.enterpriseSearch.content.engine.indices.unknownIndicesCallout.title": "您的某些索引不可用。",
"xpack.enterpriseSearch.content.engine.indicesSelect.docsLabel": "文档:", "xpack.enterpriseSearch.content.engine.indicesSelect.docsLabel": "文档:",
"xpack.enterpriseSearch.content.engine.schema.field_indices.columnTitle": "在所有索引中?", "xpack.enterpriseSearch.content.engine.schema.field_indices.columnTitle": "在所有索引中?",
"xpack.enterpriseSearch.content.engine.schema.field_indices.moreInfo": "更多信息", "xpack.enterpriseSearch.content.engine.schema.field_indices.moreInfo": "更多信息",