[Logs UI] Correctly filter for log rate anomaly examples with missing dataset (#76775)

This fixes #76493 by querying for the "unknown" (i.e. empty) dataset using an exists clause. This should be in line with how ML anomaly detection treats missing partition values.
This commit is contained in:
Felix Stürmer 2020-09-22 19:32:50 +02:00 committed by GitHub
parent 311805a57d
commit e0aeebc149
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,7 @@ export const createLogEntryExamplesQuery = (
},
},
},
...(!!dataset
...(dataset !== ''
? [
{
term: {
@ -41,7 +41,19 @@ export const createLogEntryExamplesQuery = (
},
},
]
: []),
: [
{
bool: {
must_not: [
{
exists: {
field: partitionField,
},
},
],
},
},
]),
...(categoryQuery
? [
{