elasticsearch - Children are not mapping properly in elastic to parents -
"chods": { "mappings": { "chod": { "properties": { "state": { "type": "text" } } }, "chods": {}, "variant": { "_parent": { "type": "chod" }, "_routing": { "required": true }, "properties": { "percentage": { "type": "double" } } } } },
when execute:
put /chods/variant/565?parent=36442 { // data }
it returns:
{ "_index":"chods", "_type":"variant", "_id":"565", "_version":6, "result":"updated", "_shards":{ "total":2, "successful":1, "failed":0 }, "created":false }
but when run query:
get /chods/variant/565?parent=36442
it returns variant parent=36443
{ "_index": "chods", "_type": "variant", "_id": "565", "_version": 7, "_routing": "36443", "_parent": "36443", "found": true, "_source": { ... } }
why returns parent 36443 , not 36442?
when tried reproduce steps, got expected result (version=36442). noticed after put of document "_parent": "36442"
output "_version":6
. in of document, "_version": 7
returned. possible posted version of document?
i noticed get /chods/variant/565?parent=36443
not filter parent id - query parameter disregarded. if want filter parent id, query you're looking for:
get /chods/_search { "query": { "parent_id": { "type": "variant", "id": "36442" } } }
Comments
Post a Comment