Skip to content

Commit 3b0361f

Browse files
committed
sortscripts should not be rendered empty when field OR file is set
1 parent b4914c5 commit 3b0361f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Nest/DSL/SearchDescriptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ public SearchDescriptor<T> SortScript(Func<SortScriptDescriptor<T>, IScriptSort>
715715

716716
sortSelector.ThrowIfNull("sortSelector");
717717
var descriptor = sortSelector(new SortScriptDescriptor<T>());
718-
if (descriptor == null || descriptor.Script.IsNullOrEmpty())
718+
if (descriptor == null || (descriptor.Script.IsNullOrEmpty() && descriptor.File.IsNullOrEmpty()))
719719
return this;
720720
Self.Sort.Add(new KeyValuePair<PropertyPathMarker, ISort>("_script", descriptor));
721721
return this;

0 commit comments

Comments
 (0)