Last week I upgraded to Elastic Stack 6.1. I had some performance issue for visualization.
When I looking to the Elasticsearch request body
, I found the script_fields
(named in 0, 1, 2, 3) encoded in the request body as following:
{
"size": 0,
"_source": {
"excludes": []
},
"aggs": {},
"stored_fields": [
"*"
],
"script_fields": {
"0": {
"script": {
"inline": "return 0;",
"lang": "painless"
}
},
"1": {
"script": {
"inline": "return 1;",
"lang": "painless"
}
},
"2": {
"script": {
"inline": "return 2;",
"lang": "painless"
}
},
"3": {
"script": {
"inline": "return 3;",
"lang": "painless"
}
}
},
"docvalue_fields": [
"@timestamp"
],
"query": {
"bool": {
"must": [
{
"match_all": {}
},
{
"range": {
"@timestamp": {
"gte": 1500100277053,
"lte": 1515997877053,
"format": "epoch_millis"
}
}
}
],
"filter": [],
"should": [],
"must_not": []
}
}
}
But Kibana 5.6 didn't encode the script_fields
in the request body.
{
"size": 0,
"query": {
"bool": {
"must": [
{
"match_all": {}
},
{
"range": {
"@timestamp": {
"gte": 1514736000000,
"lte": 1517414399999,
"format": "epoch_millis"
}
}
}
],
"must_not": []
}
},
"_source": {
"excludes": []
},
"aggs": {}
}
I think all of the script_fields in request body will slow down the search speed.
How can I fix it?