elasticsearch-py
elasticsearch-py copied to clipboard
[DOC] Add more Python Client code examples to main Elasticsearch Docs
👋 howdy, team!
Describe the feature:
@scranberryjam & I would like to add more Elasticsearch Client content to the Elasticsearch API docs.
example difference
Examples for Cluster API's
- does have Cluster Health
- does NOT have Allocation Explain
(Taking Python as the first language, since I'm most comfortable with it,) It doesn't appear these code examples are in-line in the Elasticsearch docs code. Instead it appears Python examples surface in Elasticsearch Docs via this repo's code for "doc examples".
Checking these files' history, it appears these may be auto-generated (last done 2023Sep via #2312, commit before)? (Is that part of the Auto-generate API?)
Do these need to be re-generated periodically or is there a project here I could help on to fill in more pages?
Initial examples confirmed not having ES-doc Python code examples: Elasticsearch doc 👉 ES-Py doc > ClusterClient
- Allocation Explain 👉
allocation_explain - Get Cluster Settings 👉
get_settings - Update Cluster Settings 👉
put_settings - Health 👉
health - Cluster Reroute 👉
reroute
EDIT : I believe the "list to generate" is determined from this code.
Thanks! I worked on the first step, which is to fix the current script that was failing with the latest examples: https://github.com/elastic/elasticsearch-py/pull/2449.
Adding more pages indeed requires adding entries in files_to_generate in that script you found, and see if the result is correct or not.
Thanks, @pquentin! 💚
@anniegale9538 / @scranberryjam, wants to take first stab, but I'll put up a PR by next week if she doesn't get to it.
These examples are live & Annie has the gist on how to do the project. Thanks for the assist, Quentin! We're interested in adding more examples & may reference this issue but core ones needed were listed and are completed, so closing. 💚