We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eefb686 commit 28fe117Copy full SHA for 28fe117
src/Search/Sorting/Sort.php
@@ -51,7 +51,6 @@ public function toDSL(): array
51
}
52
53
if ($this->script !== null) {
54
- $this->field = '_script';
55
$details['script'] = $this->script->toDSL();
56
57
@@ -61,7 +60,7 @@ public function toDSL(): array
61
60
62
$details['order'] = $this->order;
63
64
- return [$this->field => $details];
+ return [$this->script !== null ? '_script' : $this->field => $details];
65
66
67
public function __toString(): string
0 commit comments