Hi
I'm trying to do something, which I thought was pretty simple. A User can have multiple accounts and an account have multiple messages. For some reason, I can see the parents for accounts but I can't see a parent for the message.
Here are the curl messages that I'm running. Is there something I'm doing that's obviously wrong?
curl -XDELETE 'localhost:9200/myindex'
curl -v -XPUT 'localhost:9200/myindex' -H 'Content-Type: application/json' -d'
{
"mappings": {
"user": {},
"account": {
"_parent": {
"type": "user"
}
},
"message": {
"_parent": {
"type": "account"
}
}
}
}'
curl -XPUT 'localhost:9200/myindex/user/1?pretty&refresh' -H 'Content-Type: application/json' -d'
{
name: "Chris Burrell"
}
'
curl -XPUT 'localhost:9200/myindex/account/2?pretty&parent=1&refresh' -H 'Content-Type: application/json' -d'
{
"accountType": "classic",
"paymentReference": "C1",
"userId": "chris"
}
'
curl -XPUT 'localhost:9200/myindex/account/3?pretty&parent=1&refresh' -H 'Content-Type: application/json' -d'
{
"accountType": "isa",
"paymentReference": "I1",
"userId": "chris"
}
'
curl -XPUT 'localhost:9200/myindex/message/4?pretty&parent=2&refresh' -H 'Content-Type: application/json' -d'
{
"id" : "chrispir1",
"awaitingFunds": 1000,
"totalRequested": 1200,
"accountId": "chrisclassic"
}
'
curl -XPOST localhost:9200/myindex/message/_search?pretty -d'
{
"query": {
"has_parent": {
"parent_type": "account",
"query": {
"match_all": {}
}
}
}
}'
I'm a bit confused - as I had thought this use case was supported?
Thanks
Chris