-
Notifications
You must be signed in to change notification settings - Fork 732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix reading bool index setting & deprecate ElasticsearchException #1251
Conversation
…rch now exposes the errors as a structured array instead of a single string
@@ -133,13 +126,7 @@ public function getFullError() | |||
*/ | |||
public function getErrorMessage() | |||
{ | |||
$error = $this->getError(); | |||
|
|||
if (!is_string($error)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getError always returns string. So this is useless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we introduced this to make master "partially" compatible with 2.x. Happy to remove it now and lets readd it in case things break ...
* | ||
* @var bool Error | ||
*/ | ||
protected $_error = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Property that doesn't even have a getter and is not really used
@@ -185,13 +194,12 @@ public function setBlocksWrite($state = true) | |||
*/ | |||
public function getBlocksMetadata() | |||
{ | |||
// TODO will have to be replace by block.metadata.write once https://github.com/elasticsearch/elasticsearch/pull/9203 has been fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been merged and makes it possible to use the correct read_only
setting again which was changed in #738
* @param int $code Error code | ||
* @param array $error Error object from elasticsearch | ||
* @param int $code Error code | ||
* @param string $error Error message from elasticsearch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been string before and is still receiving a string in https://github.com/ruflin/Elastica/pull/1251/files#diff-38e97e4d9ad047da8141046011e72f90R66
@@ -103,6 +103,25 @@ public function get($setting = '') | |||
} | |||
|
|||
/** | |||
* Returns a setting interpreted as a bool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition. I hope that ES will also clean this up in the future and only have 1 option of returning bools.
@@ -133,13 +126,7 @@ public function getFullError() | |||
*/ | |||
public function getErrorMessage() | |||
{ | |||
$error = $this->getError(); | |||
|
|||
if (!is_string($error)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we introduced this to make master "partially" compatible with 2.x. Happy to remove it now and lets readd it in case things break ...
'off'
instead of'0'
(where just casting to bool doesn't work)