Simple nested query returns no matches

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'
         }
     ]
}

Okay, found out what's going on.
My nested property was created, but I had been inserting "statuses" into an unmapped property called: "Statuses" (The capital letter ruined it for me).

Closing.

(If anyone has any tips on moving data from a non nested "Statuses" to a nested "statuses" property that would be appreciated.)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.