# Nested query against mapped DynamoDb data does not work

**URL:** https://discuss.elastic.co/t/nested-query-against-mapped-dynamodb-data-does-not-work/120083
**Category:** Elasticsearch
**Created:** [February 15, 2018, 10:14pm UTC](https://discuss.elastic.co/t/nested-query-against-mapped-dynamodb-data-does-not-work/120083 "2018-02-15T22:14:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Pavel\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavel_k/32/45904_2.png) [@Pavel\_K](https://discuss.elastic.co/u/Pavel_K)
#### Post date: [February 15, 2018, 10:14pm UTC](https://discuss.elastic.co/t/nested-query-against-mapped-dynamodb-data-does-not-work/120083/1 "2018-02-15T22:14:44Z")

</div>

I have mapped data from DynamoDb in Elasticsearch. I want to return a document querying it by nested data. And I have a problem with the simplest nested query:

```
	{
	  "query": {
		"nested": {
		  "path": "doc.dynamodb.newImage.childCalls.M",
		  "query": {
			"bool": {
			  "minimum_should_match": 1,
			  "should": [
				{
				  "match": {
					"doc.dynamodb.newImage.childCalls.M.caller.S": "+18002427338"
				  }
				},
				{
				  "match": {
					"doc.dynamodb.newImage.childCalls.M.callee.S": "+18002427338"
				  }
				}
			  ]
			}
		  }
		}
	  }
	}

```

Looks like I missed something essential. And here is the mapping:

```
	"childCalls": {
		"properties": {
			"M": {
				"type": "nested",
				"properties": {
					"callee": {
						"properties": {
							"S": {
								"type": "string",
								"index": "not_analyzed"
							}
						}
					},
					"caller": {
						"properties": {
							"S": {
								"type": "string",
								"index": "not_analyzed"
							}
						}
					}
				}
			}
		}
	}

```

Response doesn't contain any error:

```
	{
	  "took": 1,
	  "timed_out": false,
	  "_shards": {
		"total": 1,
		"successful": 1,
		"failed": 0
	  },
	  "hits": {
		"total": 0,
		"max_score": null,
		"hits": [

		]
	  }
	}

```

And yes, index contains the document I wan't to return. Also I tried `caller.S` path and it didn't help.  
Elasticsearch version 2.4

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 15, 2018, 10:14pm UTC](https://discuss.elastic.co/t/nested-query-against-mapped-dynamodb-data-does-not-work/120083/2 "2018-03-15T22:14:50Z")

</div>

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