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>": [],
},
},
],
},
},
},
},
],
},