Skip to content

Commit

Permalink
Recommend stack Elasticsearch Python client (elastic#203981)
Browse files Browse the repository at this point in the history
## 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 <[email protected]>
  • Loading branch information
pquentin and elasticmachine authored Dec 17, 2024
1 parent da25d13 commit 46be200
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": "詳細",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": "了解详情",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ 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}",
api_key="${apiKey}"
)`,
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',
Expand All @@ -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}",
Expand All @@ -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',
Expand Down

0 comments on commit 46be200

Please sign in to comment.