Can't use example plugin in painless script

Hello everyone ! I am using a ES 7.7.0 cluster and I am trying to create a plugin to add some advanced things in my painless scripts.

To do so, I compiled this : elasticsearch/plugins/examples/painless-whitelist at 6.2 · elastic/elasticsearch · GitHub

And after installing it I confirm that the plugin is installed :

curl -sXGET "$ES/_cat/plugins" | grep painless
elasticsearch-data-1-0.elasticsearch painless-whitelist           7.7.0-SNAPSHOT
elasticsearch-data-2-0.elasticsearch painless-whitelist           7.7.0-SNAPSHOT
elasticsearch-data-3-0.elasticsearch painless-whitelist           7.7.0-SNAPSHOT

But when I am calling the example script I have this error:

    curl -H "Content-Type: application/json" -sXPOST \
    "$ES/_ingest/pipeline/_simulate" -d '{
      "pipeline": {
        "description": "x",
        "processors": [
          {
            "script": {
              "source": "def e = new ExampleWhitelistedClass(6, 42);"
            }
          }
        ]
      },
      "docs": [
        {
          "_source": "{}"
        }
      ]
    }'  
    {"error":{"root_cause":[{"type":"script_exception","reason":"compile error","processor_type":"script","script_stack":["def e = new ExampleWhitelistedClass(6 ...","            ^---- HERE"],"script":"def e = new ExampleWhitelistedClass(6, 42);","lang":"painless","position":{"offset":12,"start":0,"end":37}}],"type":"script_exception","reason":"compile error","processor_type":"script","script_stack":["def e = new ExampleWhitelistedClass(6 ...","            ^---- HERE"],"script":"def e = new ExampleWhitelistedClass(6, 42);","lang":"painless","position":{"offset":12,"start":0,"end":37},"caused_by":{"type":"illegal_argument_exception","reason":"invalid sequence of tokens near ['ExampleWhitelistedClass'].","caused_by":{"type":"no_viable_alt_exception","reason":null}}},"status":400}

I can't find any solution and if someone has a hint, it would be very cool !

Thank you in advance, have a good day !

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