Querying AWS OpenSearch low level client

I am using OpenSearch Java client to connect to my AWS endpoint.

        OpenSearchClient client = new OpenSearchClient(
                new AwsSdk2Transport(
                        httpClient,
                        domainName,
                        "es",
                        Region.EU_WEST_1,
                        AwsSdk2TransportOptions.builder()
                                .setCredentials(credentialsProvider)
                                .build()
                )
       );

I have a multi line bool query that I want to pass in SearchRequest Object. I converted the Json String of the Query to a Java BoolQueryBuilder object. Is there any way to pass this object in my search request? Or can I directly use the Json query String some how?

My example query:

        query: {
          bool: {
            filter: [
              {
                bool: {
                  minimum_should_match: 1,
                  should: [
                    {
                      nested: {
                        path: "<some-path>",
                        query: {
                          bool: {
                            minimum_should_match: 1,
                            should: [
                              {
                                terms: {
                                  "<some-term>": ['int-value'],
                                },
                              },
                              {
                                terms: {
                                  "<some-term>": [],
                                },
                              },
                            ],
                          },
                        },
                      },
                    },
                    {
                      nested: {
                        path: "<some-path>",
                        query: {
                          bool: {
                            minimum_should_match: 1,
                            should: [
                              {
                                terms: {
                                 <term>,
                                },
                              },
                              {
                                terms: {
                                  "<some-term>": [],
                                },
                              },
                            ],
                          },
                        },
                      },
                    },
                    {
                      nested: {
                        path: "<path>",
                        query: {
                          bool: {
                            minimum_should_match: 1,
                            should: [
                              {
                                terms: {
                                  "<some-term>": [68],
                                },
                              },
                              {
                                terms: {
                                  "<some-term>": [],
                                },
                              },
                            ],
                          },
                        },
                      },
                    },
                  ],
                },
             

Unlike the high level reset client, the java client has its own way to build a searchRequest, something like this:

SearchRequest searchRequest = new SearchRequest.Builder().query(
                q -> q.match(m -> m.field("text").query(FieldValue.of("Text for document 2")))
            ).build();

, you can see some examples here: opensearch-java/guides/search.md at main · opensearch-project/opensearch-java · GitHub.