-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Rename es to client in examples for consistency #2486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
removing the double index instructoins
adding the client definition since ```bulk``` and ```es``` were used without context / definition changed from es to client to stay consistent with the quickstart naming convention
upates to new branch
…roli/elasticsearch-py into iuliaferoli-es-to-client
A documentation preview will be available soon. Request a new doc build by commenting
If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thanks!
git grep "\bes\b" | grep -v '{es}' | grep -v '^test_elasticsearch'
gave three more places to update:
elasticsearch-py/elasticsearch/helpers/actions.py
Lines 659 to 663 in 66798fd
scan(es, query={"query": {"match": {"title": "python"}}}, index="orders-*", doc_type="books" ) elasticsearch-py/elasticsearch/_async/helpers.py
Lines 395 to 402 in 66798fd
.. code-block:: python async_scan( es, query={"query": {"match": {"title": "python"}}}, index="orders-*" ) """ elasticsearch-py/docs/guide/connecting.asciidoc
Lines 251 to 272 in 66798fd
from elasticsearch import Elasticsearch # Authenticate from the constructor es = Elasticsearch( "https://localhost:9200", ca_certs="/path/to/http_ca.crt", basic_auth=("username", "password") ) # Authenticate via the .options() method: es.options( basic_auth=("username", "password") ).indices.get(index="*") # You can persist the authenticated client to use # later or use for multiple API calls: auth_client = es.options(api_key="api_key") for i in range(10): auth_client.index( index="example-index", document={"field": i} )
docs/sphinx/index.rst
Outdated
@@ -65,22 +65,22 @@ Example Usage | |||
from datetime import datetime | |||
from elasticsearch import Elasticsearch | |||
|
|||
es = Elasticsearch("http://localhost:9200") | |||
client = Elasticsearch(cloud_id="YOUR_CLOUD_ID", api_key="YOUR_API_KEY") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to encourage Cloud IDs which don't really have an advantage over simple endpoints:
client = Elasticsearch(cloud_id="YOUR_CLOUD_ID", api_key="YOUR_API_KEY") | |
client = Elasticsearch("http://localhost:9200/", api_key="YOUR_API_KEY") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added those three and made the change you suggested, thanks!
(cherry picked from commit 794341d)
Changed examples / docs to only refer to the client instance as
client
rather thanes
so we now have uniform naming conventions for clarity.