The Sort Script of ES 7.4.2 is very poor

hi , all,
Our ES has been upgraded from ES 5.3.2 to 7.4.2. When you encounter a script performance problem, the execution of the same script in 7.4.2 is at least twice as slow as that in ES 5.3.2. The main method is to get data through doc['deparature_city_ids']. The Maximum size of doc['departure_city_ids'].size() is about 2000. The type is keyword.I don't know if you've ever had a similar problem.

Script is as below:

"sort": [
    {
      "_script": {
        "script": {
          "inline": "return doc['departure_city_ids'].size()",
          "lang": "painless"
        },
        "type": "number",
        "order": "desc"
      }
    }
  ]

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.