diff --git a/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java b/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java index ef96fc8c339..542903db5a7 100644 --- a/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java +++ b/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java @@ -27,8 +27,6 @@ import java.util.Map; /** * Script sort builder allows to sort based on a custom script expression. - * - * */ public class ScriptSortBuilder extends SortBuilder { @@ -100,6 +98,9 @@ public class ScriptSortBuilder extends SortBuilder { if (order == SortOrder.DESC) { builder.field("reverse", true); } + if (lang != null) { + builder.field("lang", lang); + } if (this.params != null) { builder.field("params", this.params); }