Parent with a nested child advice

I'm looking to load denormalized table data in ES, but am finding myself somewhat overwhelmed with the alternatives. Here I am attempting to created a nested child of a parent - however, I get the

"Can't specify parent if no parent field has been configured"

error when I try to add the nested child. Here's what it looks like - I'm sure the rub is somewhere in how I'm indexing the nested piece. Any help appreciated!

PUT my_index
{
"mappings": {
"my_parent": {},
"my_child": {
"_parent": {
"type": "my_parent"
}
},
"my_nested":{
"properties": {
"support": {
"type": "nested"
}
}
}
}
}

PUT my_index/my_parent/1
{
"text": "This is a parent document"
}

PUT my_index/my_child/2?parent=1
{
"text": "This is a child document"
}

PUT my_index/my_nested/4?parent=1
{
"support" : [
{
"support.support_ai":"333",
"support.support_sort":"5",
"support.suppot_desc":"Clinical Assistant",
"support.support_note":"x",
"support.support_phone":"(77)X-XXXX",
"support.support_start_date":"Nov 24",
"support.support_end_date":"Dec 31 2599 12:00:00:000AM"
},
{
"support.support_ai":"394",
"support.support_sort":"1",
"support.support_desc":"Medical Secretary",
"support.support_note":"y",
"support.support_phone":"(77)Y-YYYY",
"support.support_start_date":"Jan 1 1900",
"support.support_end_date":"Dec 31 2599 12:00:00:000AM"
}
]
}

You cannot mix parent/child and nested together like this.

I was afraid that might be the case. What would you recommend for mapping something like:

person ("parent")
-> work location (one or more)
--> phone (one or more)
--> administrative support phone (tied to work location - one or more)

My previous mapping that I had for Mongodb worked (conventional arrays,) but in Elasticsearch it wouldn't allow me to distinguish between children. Thanks in advance for any advice.

Just use multi-level children.

Parent is the person.
Child is location and phone.
Grand child is the last phone.

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