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

[BUG] DSL doesn't seem to be documented, or if it is it's hard to find.

Open stuaxo opened this issue 1 year ago • 11 comments

If I go to https://pypi.org/project/opensearch-dsl/ it says

Warning

The OpenSearch high-level Python client (opensearch-dsl-py) will be deprecated after version 2.1.0. 

We recommend switching to the OpenSearch Python client (opensearch-py), which now includes the functionality of opensearch-dsl-py.

So on visiting opensearch-py I would expect to see these usages fairly prominently, but it's not obvious at all.

These need to be signposted much better, clicking through to the User Guide, it doesn't look like the query is constructed using the DSL at all, and there is no clue it even exists.

https://github.com/opensearch-project/opensearch-py/blob/main/USER_GUIDE.md

stuaxo avatar Nov 27 '24 11:11 stuaxo

Yes, please contribute.

dblock avatar Nov 27 '24 12:11 dblock

@dblock I don't know what to contribute though:
I didn't write this because I know about the DSL, I want to use it but don't know how because I can't find the docs.

I don't know if the DSL has changed once it got incorporated, or even really where to find the old docs - I'm doing this as a beginner to OpenSearch (but not to DSLs in general)... this seems to have existed at some point, and may still do - I need pointers on where to learn this stuff first.

stuaxo avatar Nov 27 '24 13:11 stuaxo

I hear you @stuaxo. I actually don't know either! I believe the DSL didn't change, we just merged the libraries. Maybe look through https://github.com/opensearch-project/opensearch-py/tree/main/samples and possibly add one and help figure out what we ended up with ;) @saimedhi @VachaShah might know more.

dblock avatar Nov 27 '24 22:11 dblock

I might be wrong, but I assume opensearch-dsl was originally elasticsearch-dsl.

That last one has had docs generated for it.

I didn't have much luck finding them for opensearch-dsl, but maybe nobody ever generated them.

Looking at https://github.com/opensearch-project/opensearch-dsl-py there is a setup.cfg with build-sphinx, just like the one in elasticsearch-py-dsl. They both point at a "docs" directory, but opensearch-dsl has no docs directory.

stuaxocabinetoffice avatar Dec 06 '24 15:12 stuaxocabinetoffice

They both point at a "docs" directory, but opensearch-dsl has no docs directory

It's possible docs didn't make their way into the fork because they were content and not code and may have had licensing problems.

dblock avatar Dec 06 '24 19:12 dblock

Auto generated docs from docstrings could be a good start.

stuaxo avatar Dec 06 '24 21:12 stuaxo

They both point at a "docs" directory, but opensearch-dsl has no docs directory

It's possible docs didn't make their way into the fork because they were content and not code and may have had licensing problems.

This may well be the case, given the copyright footer on their docs.

stuaxocabinetoffice avatar Dec 09 '24 09:12 stuaxocabinetoffice

@stuaxo @stuaxocabinetoffice would love some help here! please make PRs

dblock avatar Dec 09 '24 12:12 dblock

@dblock Hello, still need some help on this? I'm volunteering to help with DSL documentation. We will be switching from ES to OS python library anyways, so it would be a good way to compare implementations and make some docs along the way.

Kharianne avatar Jun 26 '25 10:06 Kharianne

@stuaxo @stuaxocabinetoffice would love some help here! please make PRs

We switched our own project to postures in the end, so I'm not using OpenSearch.

I'll keep an eye on this, happy to review anything @Kharianne comes up with.

stuaxo avatar Jun 26 '25 13:06 stuaxo

@Kharianne probably yes, I am not longer working on OpenSearch full time, but this looks relevant

dblock avatar Jun 29 '25 22:06 dblock