Parent child relationship


(Vipul) #1

My mapping is as follows:

"copy_order_snapshot": {
"properties": {
"line_item_info": {
"dynamic": "true",
"properties": {
"m_product_details": {
"dynamic": "true",
"properties": {
"accessories_colour": {
"type": "string"
},
"accessories_material_type": {
"type": "string"
},
"accessories_sizes": {
"type": "string"
},
"aitmanufacturers_sort": {
"type": "string"
},
"assigned_to": {
"type": "string"
},
"attribute_set_id": {
"type": "string"
}
}
},
"meta_group_type": {
"dynamic": "true",
"properties": {
"CATEGORY": {
"type": "string"
},
"PRODUCT_GROUP": {
"type": "string"
},
"PRODUCT_TYPE": {
"type": "string"
},
"SKU_ID": {
"type": "string"
},
"prod_id": {
"type": "string"
}
}
},
"order_details": {
"dynamic": "true",
"properties": {
"amount_refunded": {
"type": "string"
},
"item_id": {
"type": "string"
},
"name": {
"type": "string"
},
"order_id": {
"type": "string"
}
}
},

            "product_details": {
                "dynamic": "true",
                "properties": {
                    "attribute_set_id": {
                        "type": "string"
                    }
                }
            },
            "supplier_details": {
                "dynamic": "true",
                "properties": {
                    "Name": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    }
                }
            }
        }
    },
    "order_data": {
        "dynamic": "true",
        "properties": {
            "entity_id": {
                "type": "string"
            }
        }
    },
    "order_id": {
        "type": "string"
    },
}

}

Now here for a particular order , there may be many items. I want a parent child relationship between every item corresponding to a particular order. In other words, there would be an array of line_item_info for each item per order. Also everything except line_item_info is same for all items in a particular order. I want to index line_item_info in such a way that each item is treated separately but at the same time maintains a relationship with its parent order.


(system) #2