How to write custome query in using opensearchclient in java spring boot without using elastic search packages and method (Mainly avoid HighLevelRestClient)

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

Describe the issue:

Configuration:

Relevant Logs or Screenshots:

How to write custome query in using opensearchclient in java spring boot without using elastic search packages and method (Mainly avoid HighLevelRestClient)

And also what java version it will support