elasticsearch-py icon indicating copy to clipboard operation
elasticsearch-py copied to clipboard

[DOC] Add more Python Client code examples to main Elasticsearch Docs

Open stefnestor opened this issue 1 year ago • 2 comments

👋 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


(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

EDIT : I believe the "list to generate" is determined from this code.

stefnestor avatar Feb 03 '24 00:02 stefnestor

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.

pquentin avatar Feb 19 '24 14:02 pquentin

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.

stefnestor avatar Feb 23 '24 18:02 stefnestor

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. 💚

stefnestor avatar Apr 26 '24 23:04 stefnestor