From 46be200a1fecdab8d41fc9c0b3a79982c4c5a961 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 17 Dec 2024 09:51:00 +0400 Subject: [PATCH] Recommend stack Elasticsearch Python client (#203981) ## Summary We're planning to retire the Elasticsearch Serverless client, so let's stop recommending it now. Using `yarn serverless` and going to http://localhost:5601/app/elasticsearch/start, I'm seeing this. Is this the page I changed? Screenshot 2024-12-12 at 18 07 15 --------- Co-authored-by: Elastic Machine --- .../private/translations/translations/fr-FR.json | 2 +- .../private/translations/translations/ja-JP.json | 2 +- .../private/translations/translations/zh-CN.json | 2 +- .../application/components/languages/python.ts | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index 8bde925660931..162b2b57ab647 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -42797,7 +42797,7 @@ "xpack.serverlessSearch.languages.php": "PHP", "xpack.serverlessSearch.languages.php.githubLink": "elasticsearch-serverless-php", "xpack.serverlessSearch.languages.python": "Python", - "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-serverless-python", + "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-py", "xpack.serverlessSearch.languages.ruby": "Ruby", "xpack.serverlessSearch.languages.ruby.githubLabel": "elasticsearch-serverless-ruby", "xpack.serverlessSearch.learnMore": "En savoir plus", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index b72b16da30b1c..b2bd6e25ec1f5 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -42654,7 +42654,7 @@ "xpack.serverlessSearch.languages.php": "PHP", "xpack.serverlessSearch.languages.php.githubLink": "elasticsearch-serverless-php", "xpack.serverlessSearch.languages.python": "Python", - "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-serverless-python", + "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-py", "xpack.serverlessSearch.languages.ruby": "Ruby", "xpack.serverlessSearch.languages.ruby.githubLabel": "elasticsearch-serverless-ruby", "xpack.serverlessSearch.learnMore": "詳細", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index b7acfdb84cdc7..479e9acd6a26d 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -42036,7 +42036,7 @@ "xpack.serverlessSearch.languages.php": "PHP", "xpack.serverlessSearch.languages.php.githubLink": "elasticsearch-serverless-php", "xpack.serverlessSearch.languages.python": "Python", - "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-serverless-python", + "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-py", "xpack.serverlessSearch.languages.ruby": "Ruby", "xpack.serverlessSearch.languages.ruby.githubLabel": "elasticsearch-serverless-ruby", "xpack.serverlessSearch.learnMore": "了解详情", diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/python.ts b/x-pack/plugins/serverless_search/public/application/components/languages/python.ts index 266a28b12c181..963d4c40ce5b6 100644 --- a/x-pack/plugins/serverless_search/public/application/components/languages/python.ts +++ b/x-pack/plugins/serverless_search/public/application/components/languages/python.ts @@ -14,7 +14,7 @@ export const pythonDefinition: LanguageDefinition = { apiReference: docLinks.pythonApiReference, basicConfig: docLinks.pythonBasicConfig, buildSearchQuery: `client.search(index="books", q="snow")`, - configureClient: ({ url, apiKey }) => `from elasticsearch_serverless import Elasticsearch + configureClient: ({ url, apiKey }) => `from elasticsearch import Elasticsearch client = Elasticsearch( "${url}", @@ -22,9 +22,9 @@ client = Elasticsearch( )`, docLink: docLinks.pythonClient, github: { - link: 'https://github.com/elastic/elasticsearch-serverless-python', + link: 'https://github.com/elastic/elasticsearch-py', label: i18n.translate('xpack.serverlessSearch.languages.python.githubLabel', { - defaultMessage: 'elasticsearch-serverless-python', + defaultMessage: 'elasticsearch-py', }), }, iconType: 'python.svg', @@ -50,7 +50,7 @@ client.bulk(operations=documents${ingestPipeline ? `, pipeline="${ingestPipeline url, indexName, ingestPipeline, - }) => `from elasticsearch_serverless import Elasticsearch + }) => `from elasticsearch import Elasticsearch client = Elasticsearch( "${url}", @@ -64,10 +64,10 @@ documents = [ client.bulk(operations=documents${ingestPipeline ? `, pipeline="${ingestPipeline}"` : ''}) `, - installClient: `python -m pip install elasticsearch-serverless + installClient: `python -m pip install elasticsearch # If your application uses async/await in Python you can install with the async extra -# python -m pip install elasticsearch_serverless[async] +# python -m pip install elasticsearch[async] `, name: i18n.translate('xpack.serverlessSearch.languages.python', { defaultMessage: 'Python',