From 73d30d9ed04651cf0c6096b74039e53fdabe1651 Mon Sep 17 00:00:00 2001 From: Jen Huang Date: Tue, 9 Jun 2020 14:19:40 -0700 Subject: [PATCH] [Ingest Manager] Update queries from `stream.*` to `dataset.*` (#68322) (#68667) Resolves #67672 Part of https://github.com/elastic/package-registry/issues/491 See https://github.com/elastic/package-registry/pull/492 for package registry changes. Updates existing queries to use `dataset.*` fields. from `stream.*` fields. I looked at the EPM code paths for asset installation, and did not find anything that would need to be changed based on the above package registry changes. We don't hardcode anything specific for field names. The package information (i.e. [nginx package info](https://epr.elastic.co/package/nginx/0.1.2/)) is not affected by the current package registry changes. --- .../server/routes/data_streams/handlers.ts | 10 +++++----- .../services/epm/elasticsearch/template/template.ts | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts index e4c860713a6f1..2c65b08a68700 100644 --- a/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/data_streams/handlers.ts @@ -31,12 +31,12 @@ export const getListHandler: RequestHandler = async (context, request, response) must: [ { exists: { - field: 'stream.namespace', + field: 'dataset.namespace', }, }, { exists: { - field: 'stream.dataset', + field: 'dataset.name', }, }, ], @@ -54,19 +54,19 @@ export const getListHandler: RequestHandler = async (context, request, response) aggs: { dataset: { terms: { - field: 'stream.dataset', + field: 'dataset.name', size: 1, }, }, namespace: { terms: { - field: 'stream.namespace', + field: 'dataset.namespace', size: 1, }, }, type: { terms: { - field: 'stream.type', + field: 'dataset.type', size: 1, }, }, diff --git a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts index 85d4a85e245c2..ef3542b7ecffd 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts @@ -388,12 +388,12 @@ const getIndexQuery = (templateName: string) => ({ must: [ { exists: { - field: 'stream.namespace', + field: 'dataset.namespace', }, }, { exists: { - field: 'stream.dataset', + field: 'dataset.name', }, }, ],