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 70baa03 commit 136fa0fCopy full SHA for 136fa0f
BulkCommand.php
@@ -72,9 +72,17 @@ public function execute()
72
$body = '{}';
73
} elseif (is_array($this->actions)) {
74
$body = '';
75
+ $prettyPrintSupport = property_exists('yii\\helpers\\Json', 'prettyPrint');
76
+ if ($prettyPrintSupport) {
77
+ $originalPrettyPrint = Json::$prettyPrint;
78
+ Json::$prettyPrint = false; // ElasticSearch bulk API uses new lines as delimiters.
79
+ }
80
foreach ($this->actions as $action) {
81
$body .= Json::encode($action) . "\n";
82
}
83
84
+ Json::$prettyPrint = $originalPrettyPrint;
85
86
} else {
87
$body = $this->actions;
88
0 commit comments