Hi All,
I am trying to convert the below relational schema to elasticsearch mapping. please correct me if it is the correct approach or suggest me for best mapping model.
POST /empdb/empdata/
{
"mappings": {
"properties": {
"employees": {
"properties": {
"emp_no": {
"type": "integer"
},
"birthdate": {
"type": "timestamp"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"gender": {
"type": "string"
},
"hire_date": {
"type": "timestamp"
}
}
},
"dept_emp": {
"properties": {
"emp_no": {
"type": "integer"
},
"dept_no": {
"type": "string"
},
"from_date": {
"type": "timestamp"
},
"to_date": {
"type": "timestamp"
}
}
},
"salaries": {
"properties": {
"emp_no": {
"type": "integer"
},
"salary": {
"type": "long"
},
"from_date": {
"type": "timestamp"
},
"to_date": {
"type": "timestamp"
}
}
},
"dept_manager": {
"properties": {
"dept_no": {
"type": "string"
},
"emp_no": {
"type": "integer"
},
"from_date": {
"type": "timestamp"
},
"to_date": {
"type": "timestamp"
}
}
},
"titles": {
"properties": {
"emp_no": {
"type": "integer"
},
"title": {
"type": "string"
},
"from_date": {
"type": "timestamp"
},
"to_date": {
"type": "timestamp"
}
}
},
" departments": {
"properties": {
"dept_no": {
"type": "integer"
},
"dept_name": {
"type": "integer"
}
}
}
}
}
}
Thanks,
Jagan