New to Elasticsearch, so please bear with me if this is a simple question that I should know. I have an index with fairly simple documents. When I try to query against anything in AppDataDict, though, I don't ever get a return. What am I doing wrong? Document, Mapping, Query, and return are below.
Document:
{
"_index": "reporting",
"_type": "_doc",
"_id": "XHw3QYIBF21eEEgTi_Aa",
"_score": 4.6823745,
"_source": {
"PageSize": 0,
"Page": 0,
"AppDataDict": {
"UserName": "Presley, Elvis",
"Location1": "R",
"Location2": "POPLAR",
"DeviceDescription": null,
"DeviceType": null,
"DeviceIP": null
},
"EventType": 1,
"EventDescription": "User logged out",
"Success": true,
"EventDate": "2022-06-20T13:59:14.893",
"Id": 191
}
}
Mapping:
{
"reporting": {
"mappings": {
"properties": {
"AppDataDict": {
"type": "nested",
"properties": {
"DeviceDescription": {
"type": "text"
},
"DeviceType": {
"type": "text"
},
"FacilityName": {
"type": "text"
},
"Location1": {
"type": "text"
},
"Location2": {
"type": "text"
},
"UserName": {
"type": "text"
}
}
},
"EventDate": {
"type": "date"
},
"EventDescription": {
"type": "text"
},
"EventType": {
"type": "integer"
},
"Id": {
"type": "long"
},
"Page": {
"type": "integer"
},
"PageSize": {
"type": "integer"
},
"Success": {
"type": "boolean"
}
}
}
}
}
Query:
{
"query": {
"bool": {
"must": [
{"match": {"AppDataDict.Location2": "POPLAR"}}
]
}
}
}
Result:
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 9,
"successful": 9,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 0,
"relation": "eq"
},
"max_score": null,
"hits": []
}
}