I am trying to achieve this elasticsearch query in java querybuilder for elasticsearch. But i am not able to get the equivalent results. Can anyone help with this.
GET /XX/XX/_search
{
"query": {
"bool": {
"must": [
{
"nested": {
"path": "XX",
"filter": {
"term": {
"A": "7:140453136:T"
}
}
}
},
{
"nested": {
"path": "XX",
"filter": {
"term": {
"B": "RF"
}
}
}
},
{
"nested": {
"path": "XX",
"filter": {
"term": {
"C": "RFFF"
}
}
}
}
]
}
}
}
The code which i tried:
QueryBuilders qbWithArguments = QueryBuilders.boolQuery()
.must(QueryBuilders.termQuery("A", "RF"))
.must(QueryBuilders.termQuery("B", "EF"))
.must(QueryBuilders.termQuery("C", "RF"));