This is the mapping initially which I created, considering that Roll number will be limit to only numbers. But eventually as they are growing in the roll numbers are Alphanumeric and the data type is changed.
PUT student_info
{
"mappings":
{
"properties":
{
"Roll_no":{"type":"integer"},
"Percentage": {"type": "float"},
"Rank": {"type": "integer"},
"Name":{"type":"text"}
}
}
}
This the 1st record I want to insert to the index student_info
This is getting indexed correctly
PUT student_info/_doc/1
{
"Roll_no":123,
"Percentage": 81.0,
"Rank":4,
"Name":"Sam"
}
This is giving error
PUT student_info/_doc/2
{
"Roll_no":"A123",
"Percentage": 83.0,
"Rank":9,
"Name":"David"
}
Error "reason": "failed to parse field [Roll_no] of type [integer] in document with id '2'. Preview of field's value: 'A123'"