Error about script_lang not supported

I am using elastic search 1.5.2. When running this query from JAVA:

  "fields" : "_source",
  "script_fields" : {
    "distance" : {
      "script" : "doc[''].empty? 0 : doc[''].distanceInMiles(lat,lon);",
      "params" : {
        "lon" : -118.412,
        "lat" : 34.087

I receive: nested: ElasticsearchIllegalArgumentException[script_lang not supported [groovy]]; }]

When running this query alone against my server it works.

Do you know what I am missing?

Are you using ES in an embedded way here? ES tries to load the groovy language when it starts up, but if the jar is missing (or it was unable to load it for other reasons), then it disables the scripting language.

You should see a "failed to load groovy" message with a stacktrace in the logs, can you post that here?

I think you have to add Groovy to your project as it's optional:


Thanks a lot @dadoonet it works now...