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 explanation streaming #7257
Conversation
Explanation explanation = new Explanation(value, description); | ||
|
||
Explanation explanation; | ||
if (in.getVersion().onOrAfter(org.elasticsearch.Version.V_1_4_0)) { |
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.
I think you can join the next conditional up to here with && in.readBoolean()
, then have just one else condition?
I left a couple comments. Looks fine overall. |
Complex explanations were always read as Explanations. Depending on if the response was streamed or not the explanation was therefore generated by a ComplexExplanation or by a regular Explanation.
0bd1654
to
5a82dd9
Compare
Thanks for the comments! Added commits. |
@@ -320,7 +320,7 @@ public static ValueAndBoost parseCreateFieldForString(ParseContext context, Stri | |||
if (token == XContentParser.Token.FIELD_NAME) { | |||
currentFieldName = parser.currentName(); | |||
} else { | |||
if ("value".equals(currentFieldName) || "_value".equals(currentFieldName)) { | |||
if ("value.j.java".equals(currentFieldName) || "_value".equals(currentFieldName)) { |
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.
Was this change intentional?
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.
definitely not! glad you spotted it...
LGTM. One oddity in the diff I left a note about. |
Removed the oddity. |
+1 to commit. |
Complex explanations were always read as Explanations. Depending on if the response was streamed or not the explanation was therefore generated by a ComplexExplanation or by a regular Explanation. closes #7257
Complex explanations were always read as Explanations. Depending on if the response was streamed or not the explanation was therefore generated by a ComplexExplanation or by a regular Explanation. closes #7257
Complex explanations were always read as Explanations. Depending
on if the response was streamed or not the explanation was
therefore generated by a ComplexExplanation or by a regular
Explanation.