Versions Opensearch 2.19.2, curl as client
Describe the issue:
We have index in our cluster with several flat_object fields:
% curl opensearch/k8s-audit-2025.30 | jq -c '.[].mappings.properties| .annotations, .responseStatus'
{"type":"flat_object"}
{"type":"flat_object"}
Here’s an example record:
% curl opensearch/k8s-audit-2025.30/_search -d'{"query":{"match_phrase":{"auditID":"fe1ee43b-199d-4f2d-a39c-01654e87a956"}}}' | jq '.hits| .total.value, .hits[0]._source.annotations, .hits[0]._source.responseStatus'
1
{
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"system:dns-autoscaler\" of ClusterRole \"system:dns-autoscaler\" to ServiceAccount \"dns-autoscaler/kube-system\""
}
{
"metadata": {},
"code": 200
}
When searching, we’ve noticed that it works while searching by ‘responseStatus’ field:
% curl opensearch/k8s-audit-2025.30/_search -d'{"query":{"match":{"responseStatus":"200"}}}' | jq .hits.total.value
10000
However, it won’t search by ‘annotations’ field:
% curl opensearch/k8s-audit-2025.30/_search -d'{"query":{"match":{"annotations":"allowed by"}}}' | jq .hits.total.value
0
% curl opensearch/k8s-audit-2025.30/_search -d'{"query":{"match_phrase":{"annotations":"allowed by"}}}' | jq .hits.total.value
0
Configuration:
Nothing special, just cluster with some data nodes, some master nodes etc.
Relevant Logs or Screenshots:
All output in description.