Skip to content

Commit e542fd2

Browse files
efegurkanelasticmachinekibanamachine
authored
[Synonyms UI] Synonyms UI base plugin (#203284)
## Summary Creates a plugin for Synonyms UI implementation. It is hidden under the UI flag and config option which is off by default. ``` POST kbn:/internal/kibana/settings/searchSynonyms:synonymsEnabled {"value": true} ``` Serverless Search: <img width="379" alt="Screenshot 2024-12-17 at 13 18 02" src="https://github.com/user-attachments/assets/8c2cb6f0-ce2a-4be6-8605-4f994adeefd7" /> Stack Search <img width="293" alt="Screenshot 2024-12-17 at 13 21 43" src="https://github.com/user-attachments/assets/0d61de0e-2cd3-46a6-990f-1f1a70843324" /> ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
1 parent 00a846f commit e542fd2

32 files changed

Lines changed: 432 additions & 1 deletion

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,7 @@ x-pack/solutions/search/plugins/search_inference_endpoints @elastic/search-kiban
963963
x-pack/solutions/search/plugins/search_notebooks @elastic/search-kibana
964964
x-pack/solutions/search/plugins/search_playground @elastic/search-kibana
965965
x-pack/solutions/search/plugins/search_solution/search_navigation @elastic/search-kibana
966+
x-pack/solutions/search/plugins/search_synonyms @elastic/search-kibana
966967
x-pack/solutions/search/plugins/serverless_search @elastic/search-kibana
967968
x-pack/solutions/security/packages/data_table @elastic/security-threat-hunting-investigations
968969
x-pack/solutions/security/packages/data-stream-adapter @elastic/security-threat-hunting

config/serverless.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ xpack.fleet.internal.activeAgentsSoftLimit: 25000
88
xpack.fleet.internal.onlyAllowAgentUpgradeToKnownVersions: true
99
xpack.fleet.internal.retrySetupOnBoot: true
1010
xpack.fleet.internal.useMeteringApi: true
11+
xpack.searchSynonyms.enabled: false
1112

1213
## Fine-tune the feature privileges.
1314
xpack.features.overrides:

docs/developer/plugin-list.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,10 @@ detailed information on how Elasticsearch executed the search request. People us
856856
to understand why a search request might be slow.
857857
858858
859+
|{kib-repo}blob/{branch}/x-pack/solutions/search/plugins/search_synonyms/README.md[searchSynonyms]
860+
|A plugin to manage synonyms in Elasticsearch through Synonyms APIs through Kibana.
861+
862+
859863
|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/security/README.md[security]
860864
|See Configuring security in
861865
Kibana.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,7 @@
815815
"@kbn/search-playground": "link:x-pack/solutions/search/plugins/search_playground",
816816
"@kbn/search-response-warnings": "link:src/platform/packages/shared/kbn-search-response-warnings",
817817
"@kbn/search-shared-ui": "link:x-pack/solutions/search/packages/search/shared_ui",
818+
"@kbn/search-synonyms": "link:x-pack/solutions/search/plugins/search_synonyms",
818819
"@kbn/search-types": "link:src/platform/packages/shared/kbn-search-types",
819820
"@kbn/searchprofiler-plugin": "link:x-pack/platform/plugins/shared/searchprofiler",
820821
"@kbn/security-api-key-management": "link:x-pack/platform/packages/shared/security/api_key_management",

packages/kbn-optimizer/limits.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ pageLoadAssetSize:
148148
searchNotebooks: 18942
149149
searchPlayground: 19325
150150
searchprofiler: 67080
151+
searchSynonyms: 20262
151152
security: 81771
152153
securitySolution: 98429
153154
securitySolutionEss: 31781

src/platform/packages/shared/deeplinks/search/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const SERVERLESS_ES_CONNECTORS_ID = 'serverlessConnectors';
1818
export const SERVERLESS_ES_WEB_CRAWLERS_ID = 'serverlessWebCrawlers';
1919
export const ES_SEARCH_PLAYGROUND_ID = 'searchPlayground';
2020
export const SERVERLESS_ES_SEARCH_INFERENCE_ENDPOINTS_ID = 'searchInferenceEndpoints';
21+
export const ES_SEARCH_SYNONYMS_ID = 'searchSynonyms';
2122
export const SEARCH_HOMEPAGE = 'searchHomepage';
2223
export const SEARCH_INDICES_START = 'elasticsearchStart';
2324
export const SEARCH_INDICES = 'elasticsearchIndices';

src/platform/packages/shared/deeplinks/search/deep_links.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
SEARCH_VECTOR_SEARCH,
2828
SEARCH_SEMANTIC_SEARCH,
2929
SEARCH_AI_SEARCH,
30+
ES_SEARCH_SYNONYMS_ID,
3031
} from './constants';
3132

3233
export type EnterpriseSearchApp = typeof ENTERPRISE_SEARCH_APP_ID;
@@ -40,6 +41,7 @@ export type ConnectorsId = typeof SERVERLESS_ES_CONNECTORS_ID;
4041
export type ServerlessWebCrawlers = typeof SERVERLESS_ES_WEB_CRAWLERS_ID;
4142
export type SearchPlaygroundId = typeof ES_SEARCH_PLAYGROUND_ID;
4243
export type SearchInferenceEndpointsId = typeof SERVERLESS_ES_SEARCH_INFERENCE_ENDPOINTS_ID;
44+
export type SearchSynonymsId = typeof ES_SEARCH_SYNONYMS_ID;
4345
export type SearchHomepage = typeof SEARCH_HOMEPAGE;
4446
export type SearchStart = typeof SEARCH_INDICES_START;
4547
export type SearchIndices = typeof SEARCH_INDICES;
@@ -56,6 +58,8 @@ export type AppsearchLinkId = 'engines';
5658

5759
export type SearchInferenceEndpointsLinkId = 'inferenceEndpoints';
5860

61+
export type SynonymsLinkId = 'synonyms';
62+
5963
export type SearchIndicesLinkId = typeof SEARCH_INDICES_CREATE_INDEX;
6064

6165
export type DeepLinkId =
@@ -70,11 +74,13 @@ export type DeepLinkId =
7074
| ServerlessWebCrawlers
7175
| SearchPlaygroundId
7276
| SearchInferenceEndpointsId
77+
| SearchSynonymsId
7378
| SearchHomepage
7479
| `${EnterpriseSearchContentApp}:${ContentLinkId}`
7580
| `${EnterpriseSearchApplicationsApp}:${ApplicationsLinkId}`
7681
| `${EnterpriseSearchAppsearchApp}:${AppsearchLinkId}`
7782
| `${SearchInferenceEndpointsId}:${SearchInferenceEndpointsLinkId}`
83+
| `${SearchSynonymsId}:${SynonymsLinkId}`
7884
| SearchStart
7985
| SearchIndices
8086
| SearchElasticsearch

tsconfig.base.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,8 @@
16061606
"@kbn/search-response-warnings/*": ["src/platform/packages/shared/kbn-search-response-warnings/*"],
16071607
"@kbn/search-shared-ui": ["x-pack/solutions/search/packages/search/shared_ui"],
16081608
"@kbn/search-shared-ui/*": ["x-pack/solutions/search/packages/search/shared_ui/*"],
1609+
"@kbn/search-synonyms": ["x-pack/solutions/search/plugins/search_synonyms"],
1610+
"@kbn/search-synonyms/*": ["x-pack/solutions/search/plugins/search_synonyms/*"],
16091611
"@kbn/search-types": ["src/platform/packages/shared/kbn-search-types"],
16101612
"@kbn/search-types/*": ["src/platform/packages/shared/kbn-search-types/*"],
16111613
"@kbn/searchprofiler-plugin": ["x-pack/platform/plugins/shared/searchprofiler"],

x-pack/solutions/search/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ export const buildBaseClassicNavItems = (): ClassicNavItem[] => {
121121
},
122122
id: 'inference_endpoints',
123123
},
124+
{
125+
'data-test-subj': 'searchSideNav-Synonyms',
126+
deepLink: {
127+
link: 'searchSynonyms:synonyms',
128+
shouldShowActiveForSubroutes: true,
129+
},
130+
id: 'synonyms',
131+
},
124132
],
125133
name: i18n.translate('xpack.enterpriseSearch.nav.relevanceTitle', {
126134
defaultMessage: 'Relevance',

x-pack/solutions/search/plugins/enterprise_search/public/navigation_tree.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ export const getNavigationTreeDefinition = ({
207207
}),
208208
},
209209
{
210-
children: [{ link: 'searchInferenceEndpoints:inferenceEndpoints' }],
210+
children: [
211+
{ link: 'searchInferenceEndpoints:inferenceEndpoints' },
212+
{ link: 'searchSynonyms:synonyms' },
213+
],
211214
id: 'relevance',
212215
title: i18n.translate('xpack.enterpriseSearch.searchNav.relevance', {
213216
defaultMessage: 'Relevance',

0 commit comments

Comments
 (0)