Elasticsearch search query with filter terms having more than 11 field names not returning proper result for 12th fieldname
{
"size":0,
"aggs":{
"filtered_data":{
"filter":{
"bool":{
"must":[
{
"term":{
"org_code.keyword": "acme"
}
},
{
"terms":{
"dp_name.keyword":[
"fieldname1",
"fieldname2",
"fieldname3",
"fieldname4",
"fieldname5",
"fieldname6",
"fieldname7",
"fieldname8",
"fieldname9",
"fieldname10",
"fieldname11",
"fieldname12"
]
}
},
{
"range":{
"@timestamp":{
"gte":"2021-01-01T00:00:00.000Z",
"lte":"2023-08-09T09:40:00.000Z"
}
}
}
]
}
},
"aggs":{
"group_by_timestamp":{
"date_histogram":{
"field":"@timestamp",
"calendar_interval":"1y"
},
"aggs":{
"group_by_dc_code":{
"terms":{
"field":"dc_code.keyword"
},
"aggs":{
"group_by_dp_name":{
"terms":{
"field":"dp_name.keyword"
},
"aggs":{
"value_stats":{
"stats":{
"field":"value"
}
},
"unit":{
"terms":{
"field":"unit.keyword"
}
}
}
}
}
}
}
}
}
}
}
}
The result of 12th field 'fieldname12' is not coming correctly, the elasticsearch index has 7 records for this field but returning only 2 of them.
Please suggest how to make the above query work properly.
Using Elasticsearch version 8.7 for the above.