Skip to content
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

Closed
wants to merge 4 commits into from
Closed

Conversation

brwe
Copy link
Contributor

@brwe brwe commented Aug 13, 2014

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.

Explanation explanation = new Explanation(value, description);

Explanation explanation;
if (in.getVersion().onOrAfter(org.elasticsearch.Version.V_1_4_0)) {
Copy link
Member

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?

@rjernst
Copy link
Member

rjernst commented Aug 21, 2014

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.
@brwe brwe force-pushed the fix-explanation-streaming branch from 0bd1654 to 5a82dd9 Compare August 21, 2014 14:42
@brwe
Copy link
Contributor Author

brwe commented Aug 21, 2014

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)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this change intentional?

Copy link
Contributor Author

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...

@rjernst
Copy link
Member

rjernst commented Aug 22, 2014

LGTM. One oddity in the diff I left a note about.

@brwe
Copy link
Contributor Author

brwe commented Aug 26, 2014

Removed the oddity.

@rjernst
Copy link
Member

rjernst commented Aug 26, 2014

+1 to commit.

@brwe brwe added v1.3.3 and removed review labels Aug 27, 2014
brwe added a commit that referenced this pull request Aug 27, 2014
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
@brwe brwe closed this in a92300c Aug 27, 2014
brwe added a commit that referenced this pull request Sep 8, 2014
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
@clintongormley clintongormley changed the title explain score: fix explanation streaming Internal: Fix explanation streaming Sep 8, 2014
@clintongormley clintongormley changed the title Internal: Fix explanation streaming Fix explanation streaming Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants