Skip to content

Conversation

@nomoa
Copy link
Contributor

@nomoa nomoa commented Mar 27, 2019

Since 6.1.0 all metadata except _index, _type and _id are accepted without the
underscore. In 6.5 it produces a deprecation warning and in 7 they are no
longer accepted.

@nomoa nomoa force-pushed the fix-underscore-prefix-in-bulk branch 2 times, most recently from 7a64fcb to 3fabc15 Compare March 27, 2019 23:39
@nomoa nomoa force-pushed the fix-underscore-prefix-in-bulk branch from 3fabc15 to 28b9555 Compare March 28, 2019 14:06
Since 6.1.0 all metadata except _index, _type and _id are accepted without the
underscore. In 6.5 it produces a deprecation warning and in 7 they are no
longer accepted.
@nomoa nomoa force-pushed the fix-underscore-prefix-in-bulk branch from 28b9555 to e9551bd Compare March 28, 2019 15:02
@nomoa nomoa changed the title Properly handle underscores in bulk request metadata Properly handle underscores in update option names Mar 28, 2019
Copy link
Owner

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

LGTM. I also feel pretty confortable to make this breaking change as we have now a 6.x branch: https://github.com/ruflin/Elastica/tree/6.x

Your initial PR would probably fit well there I'm thinking now.

$data[\ltrim($key, '_')] = $value;
unset($data[$key]);
}
return \array_filter(\array_intersect_key($this->getParams(), \array_flip($fields)));
Copy link
Owner

Choose a reason for hiding this comment

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

Nice cleanup.

@ruflin ruflin merged commit 577a1ca into ruflin:master Mar 29, 2019
@nomoa
Copy link
Contributor Author

nomoa commented Apr 1, 2019

Thanks for the merge, as for the initial patch I think it was still breaking 6.0 for users of retry_on_conflict with bulk updates.
We've patched our client code to hide the deprecation warnings so unless someone would like such feature in 6.x I'm going to leave this is as is.

@ruflin
Copy link
Owner

ruflin commented Apr 3, 2019

@nomoa I'm pretty sure it will pop up again, but lets wait until it does ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants