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

Migrate deprecated match query syntax #11554

Merged
merged 6 commits into from May 5, 2017
Jump to file or symbol
Failed to load files and symbols.
+5 −4
Diff settings

Always

Just for now

Viewing a subset of changes. View all

more declarative syntax

  • Loading branch information...
Bargs committed May 4, 2017
commit 9c753102519067a4443de13fe398437e39e2f046
@@ -5,11 +5,12 @@ export function migrateFilter(filter) {
const fieldName = Object.keys(filter.match)[0];
if (isMatchPhraseFilter(filter, fieldName)) {
const newFilter = {
match_phrase: _.clone(filter.match, true)
const params = _.get(filter, ['match', fieldName]);
return {
match_phrase: {
[fieldName]: _.omit(params, 'type'),
},
};
delete newFilter.match_phrase[fieldName].type;
return newFilter;
}
}
ProTip! Use n and p to navigate between commits in a pull request.