AntonShuvaev / elasticsearch4idea

Elasticsearch Plugin for JetBrains IDEs
https://plugins.jetbrains.com/plugin/14512-elasticsearch
59 stars 8 forks source link

Auto correction of sorting query #57

Closed spondiirty closed 2 years ago

spondiirty commented 2 years ago

I was making some queries on my index like

GET /{my-index}/_search
{
  "from": 0,
  "size": 25,
  "sort": [
    {
      "_script": {
        "type": "number",
        "script": {
          "lang": "painless",
          "source": "long reviews = doc['review'].value; return reviews;"
        },
        "order": "desc"
      }
    }
  ],
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
....

when I execute the query , it automatically correct to

...
"sort": [
    {
      "_script": {
        "order": "desc"
      }
    }
  ],
...

tried same query on Kibana and ES Head , it works no problem.

AntonShuvaev commented 2 years ago

Thanks for reporting the issue. It is fixed in 1.7.1.