My first post, please be gentle.
I have 100 Million records in an AWS ElasticSearch instance running 6.8, with the mapping:
"mappings":{
"message":{
"properties":{
"messageID":{
"type":"long"
},
"content":{
"type":"text"
},
"datetime":{
"type":"date"
},
"statuses":{
"type":"nested",
"properties": {
"datetime":{
"type":"date"
},
"status":{
"type":"keyword"
}
}
}
}
}
}
My query:
"query": {
"nested": {
"path": "statuses",
"query": {
"bool": {
"must": [
{
"match": {
"statuses.status": "sent"
}
}
]
}
}
}
}
Have confirmed there are records with a nested item with "status" = "sent" yet this query returns no matches.
ES Response:
{
took: 6,
timed_out: false,
_shards: { total: 1, successful: 1, skipped: 0, failed: 0 },
hits: { total: 0, max_score: null, hits: [] }
}
Have I done something wrong in the mapping?
Or is my query not correct for 6.8?
Queries being run from AWS Lambda via Node 10 if that helps in any way.
Example of an existing record that I expected would have matched:
{
messageID: 654602,
content: 'Test Content 7642145684296',
datetime: 1572315557,
statuses: [
{
datetime: 1572315557,
status: 'submitted'
},
{
datetime: 1572315557,
status: 'sent'
}
]
}