Skip to content

Commit 03bcc43

Browse files
committed
[Flights] Delay Bucket - Error notification on opening sample visualization
Closes: #66024
1 parent b180fd3 commit 03bcc43

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/plugins/data/common/es_query/es_query/migrate_filter.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,25 @@ export function migrateFilter(filter: Filter, indexPattern?: IIndexPattern) {
4343
if (isDeprecatedMatchPhraseFilter(filter)) {
4444
const fieldName = Object.keys(filter.query.match)[0];
4545
const params: Record<string, any> = get(filter, ['query', 'match', fieldName]);
46+
let query = params.query;
4647
if (indexPattern) {
4748
const field = indexPattern.fields.find(f => f.name === fieldName);
4849

4950
if (field) {
50-
params.query = getConvertedValueForField(field, params.query);
51+
query = getConvertedValueForField(field, params.query);
5152
}
5253
}
5354
return {
5455
...filter,
5556
query: {
5657
match_phrase: {
57-
[fieldName]: omit(params, 'type'),
58+
[fieldName]: omit(
59+
{
60+
...params,
61+
query,
62+
},
63+
'type'
64+
),
5865
},
5966
},
6067
};

0 commit comments

Comments
 (0)