Painless request returns unexpected field 'source'

Hey guys,

I have a problem with a painless request in the kibana console.

My request body looks like this:

My request
    GET logstash-2018.04.17/_search
    {
      "query": {
        "match_all": {}
      },
      "script_fields": {
        "sc_username": {
          "script":{
            "lang": "painless",
            "source": "...MyPainlessScript..."
          }
        }
      }  
    }

Kibana returns the following message:

The result
{
      "error": {
        "root_cause": [
          {
            "type": "script_parse_exception",
            "reason": "unexpected field [source]"
          }
        ],
        "type": "search_phase_execution_exception",
        "reason": "all shards failed",
        "phase": "query",
        "grouped": true,
        "failed_shards": [
          {
            "shard": 0,
            "index": "logstash-2018.04.17",
            "node": "...",
            "reason": {
              "type": "script_parse_exception",
              "reason": "unexpected field [source]"
            }
          }
        ]
      },
      "status": 500
    }

I hope anybody can help me!

Best regards,
Robert

The problem was a incompatible version of ES.

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