diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9051c3580057a..a5c25bc44048b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -922,6 +922,7 @@ x-pack/plugins/search_inference_endpoints @elastic/search-kibana x-pack/plugins/search_notebooks @elastic/search-kibana x-pack/plugins/search_playground @elastic/search-kibana x-pack/plugins/search_solution/search_navigation @elastic/search-kibana +x-pack/plugins/search_synonyms @elastic/search-kibana x-pack/plugins/security @elastic/kibana-security x-pack/plugins/serverless @elastic/appex-sharedux x-pack/plugins/serverless_search @elastic/search-kibana diff --git a/config/serverless.es.yml b/config/serverless.es.yml index 2d5ba84ece795..c715c748bb38a 100644 --- a/config/serverless.es.yml +++ b/config/serverless.es.yml @@ -132,3 +132,7 @@ aiAssistantManagementSelection.preferredAIAssistantType: "observability" xpack.observabilityAiAssistantManagement.logSourcesEnabled: false xpack.observabilityAiAssistantManagement.spacesEnabled: false xpack.observabilityAiAssistantManagement.visibilityEnabled: false + + +# Synonyms UI +xpack.searchSynonyms.enabled: false diff --git a/config/serverless.oblt.yml b/config/serverless.oblt.yml index 937954a1c5e84..234646984a9ee 100644 --- a/config/serverless.oblt.yml +++ b/config/serverless.oblt.yml @@ -9,6 +9,7 @@ xpack.securitySolution.enabled: false xpack.search.notebooks.enabled: false xpack.searchPlayground.enabled: false xpack.searchInferenceEndpoints.enabled: false +xpack.searchSynonyms.enabled: false ## Fine-tune the observability solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides. xpack.features.overrides: diff --git a/config/serverless.security.yml b/config/serverless.security.yml index 0e3a0c92f8546..fc0f29b92c127 100644 --- a/config/serverless.security.yml +++ b/config/serverless.security.yml @@ -11,6 +11,7 @@ xpack.search.notebooks.enabled: false xpack.searchPlayground.enabled: false xpack.searchInferenceEndpoints.enabled: false xpack.inventory.enabled: false +xpack.searchSynonyms.enabled: false ## Fine-tune the security solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides. xpack.features.overrides: diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index a83771cf598c2..ec88e58083917 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -856,6 +856,10 @@ detailed information on how Elasticsearch executed the search request. People us to understand why a search request might be slow. +|{kib-repo}blob/{branch}/x-pack/plugins/search_synonyms/README.md[searchSynonyms] +|A plugin to manage synonyms in Elasticsearch through Synonyms APIs through Kibana. + + |{kib-repo}blob/{branch}/x-pack/plugins/security/README.md[security] |See Configuring security in Kibana. diff --git a/package.json b/package.json index b0d9f7c093c1f..38c1037b89943 100644 --- a/package.json +++ b/package.json @@ -814,6 +814,7 @@ "@kbn/search-playground": "link:x-pack/plugins/search_playground", "@kbn/search-response-warnings": "link:packages/kbn-search-response-warnings", "@kbn/search-shared-ui": "link:x-pack/packages/search/shared_ui", + "@kbn/search-synonyms": "link:x-pack/plugins/search_synonyms", "@kbn/search-types": "link:packages/kbn-search-types", "@kbn/searchprofiler-plugin": "link:x-pack/platform/plugins/shared/searchprofiler", "@kbn/security-api-key-management": "link:x-pack/packages/security/api_key_management", diff --git a/packages/deeplinks/search/constants.ts b/packages/deeplinks/search/constants.ts index cd632c5b24a03..d1992d22da120 100644 --- a/packages/deeplinks/search/constants.ts +++ b/packages/deeplinks/search/constants.ts @@ -18,6 +18,7 @@ export const SERVERLESS_ES_CONNECTORS_ID = 'serverlessConnectors'; export const SERVERLESS_ES_WEB_CRAWLERS_ID = 'serverlessWebCrawlers'; export const ES_SEARCH_PLAYGROUND_ID = 'searchPlayground'; export const SERVERLESS_ES_SEARCH_INFERENCE_ENDPOINTS_ID = 'searchInferenceEndpoints'; +export const ES_SEARCH_SYNONYMS_ID = 'searchSynonyms'; export const SEARCH_HOMEPAGE = 'searchHomepage'; export const SEARCH_INDICES_START = 'elasticsearchStart'; export const SEARCH_INDICES = 'elasticsearchIndices'; diff --git a/packages/deeplinks/search/deep_links.ts b/packages/deeplinks/search/deep_links.ts index dcba1f7888597..662481cd038d5 100644 --- a/packages/deeplinks/search/deep_links.ts +++ b/packages/deeplinks/search/deep_links.ts @@ -27,6 +27,7 @@ import { SEARCH_VECTOR_SEARCH, SEARCH_SEMANTIC_SEARCH, SEARCH_AI_SEARCH, + ES_SEARCH_SYNONYMS_ID, } from './constants'; export type EnterpriseSearchApp = typeof ENTERPRISE_SEARCH_APP_ID; @@ -40,6 +41,7 @@ export type ConnectorsId = typeof SERVERLESS_ES_CONNECTORS_ID; export type ServerlessWebCrawlers = typeof SERVERLESS_ES_WEB_CRAWLERS_ID; export type SearchPlaygroundId = typeof ES_SEARCH_PLAYGROUND_ID; export type SearchInferenceEndpointsId = typeof SERVERLESS_ES_SEARCH_INFERENCE_ENDPOINTS_ID; +export type SearchSynonymsId = typeof ES_SEARCH_SYNONYMS_ID; export type SearchHomepage = typeof SEARCH_HOMEPAGE; export type SearchStart = typeof SEARCH_INDICES_START; export type SearchIndices = typeof SEARCH_INDICES; @@ -56,6 +58,8 @@ export type AppsearchLinkId = 'engines'; export type SearchInferenceEndpointsLinkId = 'inferenceEndpoints'; +export type SynonymsLinkId = 'synonyms'; + export type SearchIndicesLinkId = typeof SEARCH_INDICES_CREATE_INDEX; export type DeepLinkId = @@ -70,11 +74,13 @@ export type DeepLinkId = | ServerlessWebCrawlers | SearchPlaygroundId | SearchInferenceEndpointsId + | SearchSynonymsId | SearchHomepage | `${EnterpriseSearchContentApp}:${ContentLinkId}` | `${EnterpriseSearchApplicationsApp}:${ApplicationsLinkId}` | `${EnterpriseSearchAppsearchApp}:${AppsearchLinkId}` | `${SearchInferenceEndpointsId}:${SearchInferenceEndpointsLinkId}` + | `${SearchSynonymsId}:${SynonymsLinkId}` | SearchStart | SearchIndices | SearchElasticsearch diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 85434fe0f2b21..0a57a76a9725a 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -148,6 +148,7 @@ pageLoadAssetSize: searchNotebooks: 18942 searchPlayground: 19325 searchprofiler: 67080 + searchSynonyms: 20262 security: 81771 securitySolution: 98429 securitySolutionEss: 31781 diff --git a/tsconfig.base.json b/tsconfig.base.json index 84c8cb68d811a..a87ac60735326 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1604,6 +1604,8 @@ "@kbn/search-response-warnings/*": ["packages/kbn-search-response-warnings/*"], "@kbn/search-shared-ui": ["x-pack/packages/search/shared_ui"], "@kbn/search-shared-ui/*": ["x-pack/packages/search/shared_ui/*"], + "@kbn/search-synonyms": ["x-pack/plugins/search_synonyms"], + "@kbn/search-synonyms/*": ["x-pack/plugins/search_synonyms/*"], "@kbn/search-types": ["packages/kbn-search-types"], "@kbn/search-types/*": ["packages/kbn-search-types/*"], "@kbn/searchprofiler-plugin": ["x-pack/platform/plugins/shared/searchprofiler"], diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx index 7fe1ba1e017c6..52cd6fe664adc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx @@ -121,6 +121,14 @@ export const buildBaseClassicNavItems = (): ClassicNavItem[] => { }, id: 'inference_endpoints', }, + { + 'data-test-subj': 'searchSideNav-Synonyms', + deepLink: { + link: 'searchSynonyms:synonyms', + shouldShowActiveForSubroutes: true, + }, + id: 'synonyms', + }, ], name: i18n.translate('xpack.enterpriseSearch.nav.relevanceTitle', { defaultMessage: 'Relevance', diff --git a/x-pack/plugins/enterprise_search/public/navigation_tree.ts b/x-pack/plugins/enterprise_search/public/navigation_tree.ts index 1485ecd8536f3..3525a546c0676 100644 --- a/x-pack/plugins/enterprise_search/public/navigation_tree.ts +++ b/x-pack/plugins/enterprise_search/public/navigation_tree.ts @@ -207,7 +207,10 @@ export const getNavigationTreeDefinition = ({ }), }, { - children: [{ link: 'searchInferenceEndpoints:inferenceEndpoints' }], + children: [ + { link: 'searchInferenceEndpoints:inferenceEndpoints' }, + { link: 'searchSynonyms:synonyms' }, + ], id: 'relevance', title: i18n.translate('xpack.enterpriseSearch.searchNav.relevance', { defaultMessage: 'Relevance', diff --git a/x-pack/plugins/search_synonyms/README.md b/x-pack/plugins/search_synonyms/README.md new file mode 100644 index 0000000000000..7409c829e67e0 --- /dev/null +++ b/x-pack/plugins/search_synonyms/README.md @@ -0,0 +1,3 @@ +# Search Synonyms + +A plugin to manage synonyms in Elasticsearch through Synonyms APIs through Kibana. \ No newline at end of file diff --git a/x-pack/plugins/search_synonyms/common/index.ts b/x-pack/plugins/search_synonyms/common/index.ts new file mode 100644 index 0000000000000..31c4a7869f5e7 --- /dev/null +++ b/x-pack/plugins/search_synonyms/common/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const PLUGIN_ID = 'searchSynonyms'; +export const PLUGIN_NAME = 'Synonyms'; diff --git a/x-pack/plugins/search_synonyms/common/types.ts b/x-pack/plugins/search_synonyms/common/types.ts new file mode 100644 index 0000000000000..90fc8bbe91a89 --- /dev/null +++ b/x-pack/plugins/search_synonyms/common/types.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SearchSynonymsPluginSetup {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface SearchSynonymsPluginStart {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface AppPluginSetupDependencies {} + +export interface SearchSynonymsConfigType { + enabled: boolean; +} diff --git a/x-pack/plugins/search_synonyms/jest.config.js b/x-pack/plugins/search_synonyms/jest.config.js new file mode 100644 index 0000000000000..5dc5e60c49cfe --- /dev/null +++ b/x-pack/plugins/search_synonyms/jest.config.js @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../..', + roots: ['/x-pack/plugins/search_synonyms'], + coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/search_synonyms', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['/x-pack/plugins/search_synonyms/{public,server}/**/*.{ts,tsx}'], +}; diff --git a/x-pack/plugins/search_synonyms/kibana.jsonc b/x-pack/plugins/search_synonyms/kibana.jsonc new file mode 100644 index 0000000000000..26d5ac84de49f --- /dev/null +++ b/x-pack/plugins/search_synonyms/kibana.jsonc @@ -0,0 +1,29 @@ +{ + "type": "plugin", + "id": "@kbn/search-synonyms", + "owner": "@elastic/search-kibana", + "group": "search", + "visibility": "private", + "plugin": { + "id": "searchSynonyms", + "server": true, + "browser": true, + "configPath": [ + "xpack", + "searchSynonyms" + ], + "requiredPlugins": [ + "licensing", + "features", + ], + "optionalPlugins": [ + "cloud", + "console", + "usageCollection", + "searchNavigation", + ], + "requiredBundles": [ + "kibanaReact", + ] + } +} diff --git a/x-pack/plugins/search_synonyms/public/application.tsx b/x-pack/plugins/search_synonyms/public/application.tsx new file mode 100644 index 0000000000000..d62f8196e7282 --- /dev/null +++ b/x-pack/plugins/search_synonyms/public/application.tsx @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import ReactDOM from 'react-dom'; +import { CoreStart } from '@kbn/core/public'; +import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { I18nProvider } from '@kbn/i18n-react'; +import { Router } from '@kbn/shared-ux-router'; +import { AppPluginStartDependencies } from './types'; + +export const renderApp = async ( + core: CoreStart, + services: AppPluginStartDependencies, + element: HTMLElement +) => { + ReactDOM.render( + + + + +
Synonyms
+
+
+
+
, + element + ); + return () => ReactDOM.unmountComponentAtNode(element); +}; diff --git a/x-pack/plugins/search_synonyms/public/index.ts b/x-pack/plugins/search_synonyms/public/index.ts new file mode 100644 index 0000000000000..4e1d1ab027e03 --- /dev/null +++ b/x-pack/plugins/search_synonyms/public/index.ts @@ -0,0 +1,16 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PluginInitializerContext } from '@kbn/core/public'; + +import { SearchSynonymsPlugin } from './plugin'; + +export function plugin(initializerContext: PluginInitializerContext) { + return new SearchSynonymsPlugin(initializerContext); +} + +export const SYNONYMS_UI_FLAG = 'searchSynonyms:synonymsEnabled'; diff --git a/x-pack/plugins/search_synonyms/public/plugin.ts b/x-pack/plugins/search_synonyms/public/plugin.ts new file mode 100644 index 0000000000000..e345213e21587 --- /dev/null +++ b/x-pack/plugins/search_synonyms/public/plugin.ts @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { + CoreSetup, + Plugin, + PluginInitializerContext, + AppMountParameters, +} from '@kbn/core/public'; +import { i18n } from '@kbn/i18n'; +import { PLUGIN_ID, PLUGIN_NAME } from '../common'; +import { + AppPluginSetupDependencies, + AppPluginStartDependencies, + SearchSynonymsConfigType, + SearchSynonymsPluginSetup, + SearchSynonymsPluginStart, +} from './types'; +import { SYNONYMS_UI_FLAG } from '.'; + +export class SearchSynonymsPlugin + implements Plugin +{ + private config: SearchSynonymsConfigType; + constructor(initializerContext: PluginInitializerContext) { + this.config = initializerContext.config.get(); + } + + public setup( + core: CoreSetup, + _: AppPluginSetupDependencies + ): SearchSynonymsPluginSetup { + if (!this.config.enabled || !core.uiSettings.get(SYNONYMS_UI_FLAG, false)) { + return {}; + } + core.application.register({ + id: PLUGIN_ID, + appRoute: '/app/elasticsearch/synonyms', + title: PLUGIN_NAME, + deepLinks: [ + { + id: 'synonyms', + path: '/', + title: i18n.translate('xpack.searchSynonyms.appTitle', { + defaultMessage: 'Synonyms', + }), + visibleIn: ['globalSearch'], + }, + ], + async mount({ element, history }: AppMountParameters) { + const { renderApp } = await import('./application'); + const [coreStart, depsStart] = await core.getStartServices(); + + coreStart.chrome.docTitle.change(PLUGIN_NAME); + + const startDeps: AppPluginStartDependencies = { + ...depsStart, + history, + }; + + depsStart.searchNavigation?.handleOnAppMount(); + + return renderApp(coreStart, startDeps, element); + }, + visibleIn: [], + }); + + return {}; + } + + public start(): SearchSynonymsPluginStart { + return {}; + } + + public stop() {} +} diff --git a/x-pack/plugins/search_synonyms/public/types.ts b/x-pack/plugins/search_synonyms/public/types.ts new file mode 100644 index 0000000000000..d30d4fad2aacf --- /dev/null +++ b/x-pack/plugins/search_synonyms/public/types.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { SearchNavigationPluginStart } from '@kbn/search-navigation/public'; +export * from '../common/types'; + +export interface AppPluginStartDependencies { + history: AppMountParameters['history']; + console?: ConsolePluginStart; + searchNavigation: SearchNavigationPluginStart; +} +import { AppMountParameters } from '@kbn/core/public'; +import type { ConsolePluginStart } from '@kbn/console-plugin/public'; diff --git a/x-pack/plugins/search_synonyms/server/config.ts b/x-pack/plugins/search_synonyms/server/config.ts new file mode 100644 index 0000000000000..f1f151475fb50 --- /dev/null +++ b/x-pack/plugins/search_synonyms/server/config.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; +import { PluginConfigDescriptor } from '@kbn/core/server'; + +const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: false }), +}); + +export type SearchPlaygroundConfig = TypeOf; + +export const config: PluginConfigDescriptor = { + exposeToBrowser: { + enabled: true, + }, + schema: configSchema, +}; diff --git a/x-pack/plugins/search_synonyms/server/index.ts b/x-pack/plugins/search_synonyms/server/index.ts new file mode 100644 index 0000000000000..9b8e954852ef7 --- /dev/null +++ b/x-pack/plugins/search_synonyms/server/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PluginInitializerContext } from '@kbn/core/server'; + +export { config } from './config'; + +export async function plugin(initializerContext: PluginInitializerContext) { + const { SearchSynonymsPlugin } = await import('./plugin'); + return new SearchSynonymsPlugin(initializerContext); +} + +export type { SearchSynonymsPluginSetup, SearchSynonymsPluginStart } from './types'; diff --git a/x-pack/plugins/search_synonyms/server/plugin.ts b/x-pack/plugins/search_synonyms/server/plugin.ts new file mode 100644 index 0000000000000..0281c22d4e769 --- /dev/null +++ b/x-pack/plugins/search_synonyms/server/plugin.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + PluginInitializerContext, + CoreSetup, + CoreStart, + Plugin, + Logger, + DEFAULT_APP_CATEGORIES, +} from '@kbn/core/server'; + +import { KibanaFeatureScope } from '@kbn/features-plugin/common'; +import { + SearchSynonymsPluginSetup, + SearchSynonymsPluginSetupDependencies, + SearchSynonymsPluginStart, +} from './types'; + +import { defineRoutes } from './routes'; +import { PLUGIN_ID, PLUGIN_NAME } from '../common'; + +export class SearchSynonymsPlugin + implements Plugin +{ + private readonly logger: Logger; + + constructor(initializerContext: PluginInitializerContext) { + this.logger = initializerContext.logger.get(); + } + + public setup(core: CoreSetup, plugins: SearchSynonymsPluginSetupDependencies) { + this.logger.debug('searchSynonyms: Setup'); + const router = core.http.createRouter(); + + defineRoutes({ router, logger: this.logger }); + + plugins.features.registerKibanaFeature({ + id: PLUGIN_ID, + name: PLUGIN_NAME, + order: 0, + category: DEFAULT_APP_CATEGORIES.enterpriseSearch, + app: ['kibana', PLUGIN_ID], + scope: [KibanaFeatureScope.Spaces, KibanaFeatureScope.Security], + catalogue: [PLUGIN_ID], + privileges: { + all: { + app: ['kibana', PLUGIN_ID], + api: ['synonyms:manage', 'synonyms:read'], + catalogue: [PLUGIN_ID], + savedObject: { + all: [], + read: [], + }, + ui: ['read', 'save'], + }, + read: { + app: ['kibana', PLUGIN_ID], + api: ['synonyms:read'], + savedObject: { + all: [], + read: [], + }, + ui: ['read'], + }, + }, + }); + + return {}; + } + + public start(core: CoreStart) { + return {}; + } + + public stop() {} +} diff --git a/x-pack/plugins/search_synonyms/server/routes.ts b/x-pack/plugins/search_synonyms/server/routes.ts new file mode 100644 index 0000000000000..9411887ffb311 --- /dev/null +++ b/x-pack/plugins/search_synonyms/server/routes.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IRouter, Logger } from '@kbn/core/server'; + +export function defineRoutes({ logger, router }: { logger: Logger; router: IRouter }) {} diff --git a/x-pack/plugins/search_synonyms/server/types.ts b/x-pack/plugins/search_synonyms/server/types.ts new file mode 100644 index 0000000000000..de63a55f0b023 --- /dev/null +++ b/x-pack/plugins/search_synonyms/server/types.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FeaturesPluginSetup } from '@kbn/features-plugin/server'; +export * from '../common/types'; + +export interface SearchSynonymsPluginSetupDependencies { + features: FeaturesPluginSetup; +} diff --git a/x-pack/plugins/search_synonyms/tsconfig.json b/x-pack/plugins/search_synonyms/tsconfig.json new file mode 100644 index 0000000000000..281487212ad4d --- /dev/null +++ b/x-pack/plugins/search_synonyms/tsconfig.json @@ -0,0 +1,27 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + }, + "include": [ + "__mocks__/**/*", + "common/**/*", + "public/**/*", + "server/**/*", + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/core", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/kibana-react-plugin", + "@kbn/shared-ux-router", + "@kbn/react-kibana-context-render", + "@kbn/console-plugin", + "@kbn/features-plugin", + "@kbn/search-navigation", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/x-pack/plugins/serverless_search/public/navigation_tree.ts b/x-pack/plugins/serverless_search/public/navigation_tree.ts index 7d62be658166a..d9b4982928045 100644 --- a/x-pack/plugins/serverless_search/public/navigation_tree.ts +++ b/x-pack/plugins/serverless_search/public/navigation_tree.ts @@ -103,6 +103,13 @@ export const navigationTree = ({ isAppRegistered }: ApplicationStart): Navigatio ), link: 'searchInferenceEndpoints', }, + { + id: 'searchSynonyms', + title: i18n.translate('xpack.serverlessSearch.nav.relevance.searchSynonyms', { + defaultMessage: 'Synonyms', + }), + link: 'searchSynonyms', + }, ], }, { diff --git a/x-pack/test/api_integration/apis/features/features/features.ts b/x-pack/test/api_integration/apis/features/features/features.ts index bbdce7ab42912..4ca972549f0cb 100644 --- a/x-pack/test/api_integration/apis/features/features/features.ts +++ b/x-pack/test/api_integration/apis/features/features/features.ts @@ -185,6 +185,7 @@ export default function ({ getService }: FtrProviderContext) { 'rulesSettings', 'uptime', 'searchInferenceEndpoints', + 'searchSynonyms', 'searchPlayground', 'siem', 'slo', diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts index 71324846b2160..4e9401cc41481 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts @@ -89,6 +89,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { 'enterpriseSearchElasticsearch', 'searchPlayground', 'searchInferenceEndpoints', + 'searchSynonyms', 'appSearch', 'observabilityAIAssistant', 'workplaceSearch', diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts index 75408726ab8c9..a75dd62e6c6bc 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts @@ -63,6 +63,7 @@ export default function navLinksTests({ getService }: FtrProviderContext) { 'enterpriseSearchAnalytics', 'searchPlayground', 'searchInferenceEndpoints', + 'searchSynonyms', 'guidedOnboardingFeature', 'securitySolutionAssistant', 'securitySolutionAttackDiscovery', diff --git a/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts b/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts index b7c818821d36c..538e575379f01 100644 --- a/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts +++ b/x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts @@ -37,6 +37,9 @@ export default createTestConfig({ searchPlayground: { pathname: '/app/search_playground', }, + searchSynonyms: { + pathname: '/app/search_synonyms', + }, elasticsearchStart: { pathname: '/app/elasticsearch/start', }, diff --git a/yarn.lock b/yarn.lock index 84be1ce3cd650..b6a7ebd03d781 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7025,6 +7025,10 @@ version "0.0.0" uid "" +"@kbn/search-synonyms@link:x-pack/plugins/search_synonyms": + version "0.0.0" + uid "" + "@kbn/search-types@link:packages/kbn-search-types": version "0.0.0" uid ""