We have a use case that require us to fetch all records that has an exact match on any field value. E.g. check if any of the below field has a exact string value as "auto-scaling-groups"
Record 1: { "name": "auto-scaling-groups", "created_by": "John" }
Record 2: { "name": "postgres-db-node", "managed_by": "auto-scaling-groups" }
Record 3: { "name": "postgres-db-cluster", "managed_by": "auto-scaling-groups-manager"}
Record 4: { "name": "postgres-db-monitoring", "managed_by": "auto-scaling-scheduler"}
The query result should only return records 1 and 2 but not 3 and 4.
Please note that we have ES cluster v1.7 and do not have luxury of using latest features such as keyword
analyzer as below.
{
"query": {
"query_string": {
"query": "auto-scaling-groups",
"analyzer": "keyword"
}
}
}