Nested query against mapped DynamoDb data does not work


(Pavel K) #1

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


(system) #2

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