Skip to content

Commit

Permalink
Updated changelog for #344 (Disabled JSON pretty print for ElasticSea…
Browse files Browse the repository at this point in the history
…rch bulk API)
  • Loading branch information
rhertogh committed Jul 10, 2023
1 parent 136fa0f commit c715e47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions BulkCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ public function execute()
$body = '{}';
} elseif (is_array($this->actions)) {
$body = '';
$prettyPrintSupport = property_exists('yii\\helpers\\Json', 'prettyPrint');
if ($prettyPrintSupport) {
$prettyPrintSupported = property_exists('yii\\helpers\\Json', 'prettyPrint');
if ($prettyPrintSupported) {
$originalPrettyPrint = Json::$prettyPrint;
Json::$prettyPrint = false; // ElasticSearch bulk API uses new lines as delimiters.
}
foreach ($this->actions as $action) {
$body .= Json::encode($action) . "\n";
}
if ($prettyPrintSupport) {
if ($prettyPrintSupported) {
Json::$prettyPrint = $originalPrettyPrint;
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Yii Framework 2 Elasticsearch extension Change Log
2.1.5 under development
-----------------------

- no changes in this release.
- Bug #344: Disabled JSON pretty print for ElasticSearch bulk API (rhertogh)


2.1.4 May 22, 2023
Expand Down

0 comments on commit c715e47

Please sign in to comment.