{
$schema: "https://vega.github.io/schema/vega-lite/v2.json"
data: {
url: {
%context%: true
index: index_ssd_2
body: {
size: 10000,
_source: ["mediatype","pred_comp_sem","Gender","PhotoOfPerson"],
script_fields : {
photo : {
script : {
lang: 'painless',
source: (doc['PhotoOfPerson'].value) / 2
}
}
}
}
}
format: { property: "hits.hits" }
},
"transform": [
{
"joinaggregate": [{
"op": "sum",
"field": "fields.photo",
"as": "a_pop"
}]
}
],
"mark": {
"type": "text",
"fontSize": 32,
"align":"center",
"dx": -240,
"dy": 12
},
"encoding": {
"text": {"field": "a_pop", "type": "quantitative"}
}
}
In vega visualzation I tried to create a scripted field....it's showing bad request as error, may I know where exactly I went wrong