[Solved] [2.4.3] Here's my query. It's only returning the script_field, new_sales, and forgets about returning the source. What can I do to return my _source document as well as the calculated field.
Thanks!
GET weekly_sales/_search
{
"query": {
"match_all": {}
},
"script_fields": {
"new_sales": {
"script": "doc['total_sale_amount'].value * 2"
}
}
}
#example return:
"hits": [
{
"_index": "weekly_sales",
"_type": "weekly_sales",
"_id": "304-02-0689-2016-12-17-3004",
"_score": 1,
"fields": {
"new_sales": [
-16.62
]
}
}]