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?

<img width="612" alt="Screenshot 2024-12-12 at 18 07 15"
src="https://github.com/user-attachments/assets/4158f2dd-8fff-453e-a80c-9390a2ec536e"
/>

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Quentin Pradet 2024-12-17 09:51:00 +04:00 committed by GitHub
parent da25d13a2a
commit 46be200a1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 9 deletions

View file

@ -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",

View file

@ -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": "詳細",

View file

@ -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": "了解详情",

View file

@ -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',