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

Reindex: don't duplicate _source parameter #24629

Merged
merged 1 commit into from May 11, 2017

Conversation

@nik9000
Copy link
Contributor

commented May 11, 2017

If the request asks for the _source stored field then don't
duplicate it when forcing the _source parameter to onto the
request for reindex-from-remote from versions before 1.0.

Closes #24628

If the request asks for the `_source` stored field then don't
duplicate it when forcing the `_source` parameter to onto the
request for reindex-from-remote from versions before 1.0.

Closes #24628
@jimczi
jimczi approved these changes May 11, 2017
Copy link
Member

left a comment

LGTM

@@ -103,7 +103,9 @@ static String initialSearchPath(SearchRequest searchRequest) {
searchRequest.source().storedField("_parent").storedField("_routing").storedField("_ttl");
if (remoteVersion.before(Version.fromId(1000099))) {
// Versions before 1.0.0 don't support `"_source": true` so we have to ask for the _source in a funny way.
searchRequest.source().storedField("_source");
if (false == searchRequest.source().storedFields().fieldNames().contains("_source")) {

This comment has been minimized.

Copy link
@glefloch

glefloch May 11, 2017

Contributor

Why don't you just do if (!searchRequest.source().storedFields().fieldNames().contains("_source")) { as contains returns a boolean ?

This comment has been minimized.

Copy link
@nik9000

nik9000 May 11, 2017

Author Contributor

Elasticsearch has this thing about == false instead of !. I think it has something to do with ! being easy to miss when visually scanning the line.

@nik9000 nik9000 merged commit 2ad509f into elastic:5.x May 11, 2017
1 of 2 checks passed
1 of 2 checks passed
elasticsearch-ci Build finished.
Details
CLA Commit author has signed the CLA
Details
nik9000 added a commit that referenced this pull request May 11, 2017
If the request asks for the `_source` stored field then don't
duplicate it when forcing the `_source` parameter to onto the
request for reindex-from-remote from versions before 1.0.

Closes #24628
nik9000 added a commit that referenced this pull request May 11, 2017
If the request asks for the `_source` stored field then don't
duplicate it when forcing the `_source` parameter to onto the
request for reindex-from-remote from versions before 1.0.

Closes #24628
@nik9000

This comment has been minimized.

Copy link
Contributor Author

commented May 11, 2017

Thanks for reviewing @jimczi and @glefloch!

@nik9000 nik9000 deleted the nik9000:reindex_do_not_duplicate__source branch Jun 7, 2017
@clintongormley clintongormley added v6.0.0-beta1 and removed v6.0.0 labels Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.