Hi,
I have a Explicit mapping defined on Elasticsearch and i want to post data in the exact format (not allowing additional properties/fields ).
eg: I have the following template defined with name biodata which gets applied to indexes starting with test*.
PUT /_template/biodata
{
"template": "test*",
"settings": {
"number_of_shards": 1
},
"mappings": {
"address" : {
"_source": {
"enabled": true
},
"properties": {
"firstname": {
"type": "string",
"index": "not_analyzed"
},
"DOB": {
"type": "date",
"format": "dd/MM/yyyy HH:mm:ss"
}
}
}
}
}
This mapping has type "address" which contains 2 properties "firstname" and "DOB". Now, i don't want Elasticsearch to accept the request which is like
POST /testindex/address/1
{
"firstname" : "SAMPLE FIRST NAME",
"DOB" : "14/09/1980 00:00:00",
"lastname" : "TEST LAST NAME",
"contact" : 123456789
}
OR
POST /testindex/address/1
{
"DOB" : "14/09/1980 00:00:00"
}
How can i achieve this? Please help
Thanks and Regards,
RK