Scripted fields in kibana to elastic?

i have create a scripted field query search and filter it. but the hits i founds is zero. and show the error like :

#! Deprecation: Deprecated field [inline] used, expected [source] instead
{
"took": 1542,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 0,
"relation": "eq"
},
"max_score": null,
"hits":
}
}

this the script i create and i use query term to get data.
"script_fields": {
"date": {
"script": {
"lang": "painless",
"inline": "if (doc['status'].size() <= 0) {return 'IN PROGRESS';}def status = doc['status'].value;if(status == 0) {return 'IN PROGRESS';}else if(status == 1) {return 'DELIVERED';}else if(status == 2) {return 'LOST/BROKEN';}else if(status == 3) {return 'RETURNED';}else if(status == 99) {return 'CANCELLED';}else{return 'FAILED';}"
}

can i get the result?