From dee335b5d1b1ef28f8504539f3cef20ca812bc88 Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Fri, 29 Jun 2018 15:21:46 -0400 Subject: [PATCH 1/3] only allow filters to be passed to getQueryParams --- .../saved_objects/service/lib/repository.js | 10 +- .../service/lib/repository.test.js | 15 +- .../service/lib/search_dsl/query_params.js | 46 +--- .../lib/search_dsl/query_params.test.js | 228 ++++++++++++------ .../service/lib/search_dsl/search_dsl.js | 8 +- .../service/lib/search_dsl/search_dsl.test.js | 6 +- .../saved_objects_client/lib/query_params.js | 10 +- .../lib/query_params.test.js | 20 +- .../spaces_saved_objects_client.js | 6 +- 9 files changed, 211 insertions(+), 138 deletions(-) diff --git a/src/server/saved_objects/service/lib/repository.js b/src/server/saved_objects/service/lib/repository.js index 7e400cdcd5ecf..93cef292b79b8 100644 --- a/src/server/saved_objects/service/lib/repository.js +++ b/src/server/saved_objects/service/lib/repository.js @@ -211,7 +211,7 @@ export class SavedObjectsRepository { * @property {string} [options.search] * @property {Array} [options.searchFields] - see Elasticsearch Simple Query String * Query field argument for more information - * @property {object} [options.extraQueryParams] - ES Query parameters to merge/append into the generated query + * @property {object} [options.filters] - ES Query filters to append * @property {integer} [options.page=1] * @property {integer} [options.perPage=20] * @property {string} [options.sortField] @@ -229,7 +229,7 @@ export class SavedObjectsRepository { sortField, sortOrder, fields, - extraQueryParams, + filters, } = options; if (searchFields && !Array.isArray(searchFields)) { @@ -240,8 +240,8 @@ export class SavedObjectsRepository { throw new TypeError('options.searchFields must be an array'); } - if (extraQueryParams && typeof extraQueryParams !== 'object') { - throw new TypeError('options.extraQueryParams must be an object'); + if (filters && !Array.isArray(filters)) { + throw new TypeError('options.filters must be an array'); } const esOptions = { @@ -258,7 +258,7 @@ export class SavedObjectsRepository { type, sortField, sortOrder, - extraQueryParams + filters }) } }; diff --git a/src/server/saved_objects/service/lib/repository.test.js b/src/server/saved_objects/service/lib/repository.test.js index b5938e26a83c0..0301968674a49 100644 --- a/src/server/saved_objects/service/lib/repository.test.js +++ b/src/server/saved_objects/service/lib/repository.test.js @@ -439,14 +439,25 @@ describe('SavedObjectsRepository', () => { } }); - it('passes mappings, search, searchFields, type, sortField, extraQueryParams, and sortOrder to getSearchDsl', async () => { + it('requires filters to be an array if defined', async () => { + try { + await savedObjectsRepository.find({ filters: 'string' }); + throw new Error('expected find() to reject'); + } catch (error) { + sinon.assert.notCalled(callAdminCluster); + sinon.assert.notCalled(onBeforeWrite); + expect(error.message).toMatch('must be an array'); + } + }); + + it('passes mappings, search, searchFields, type, sortField, filters, and sortOrder to getSearchDsl', async () => { const relevantOpts = { search: 'foo*', searchFields: ['foo'], type: 'bar', sortField: 'name', sortOrder: 'desc', - extraQueryParams: { bool: {} }, + filters: [{ bool: {} }], }; await savedObjectsRepository.find(relevantOpts); diff --git a/src/server/saved_objects/service/lib/search_dsl/query_params.js b/src/server/saved_objects/service/lib/search_dsl/query_params.js index f5986de2bb8da..c5ca55f985bdd 100644 --- a/src/server/saved_objects/service/lib/search_dsl/query_params.js +++ b/src/server/saved_objects/service/lib/search_dsl/query_params.js @@ -17,7 +17,6 @@ * under the License. */ -import { defaultsDeep } from 'lodash'; import { getRootPropertiesObjects } from '../../../../mappings'; /** @@ -66,23 +65,21 @@ function getFieldsForTypes(searchFields, types) { * @param {(string|Array)} type * @param {String} search * @param {Array} searchFields - * @param {Object} extraQueryParams query parameters to merge into the result + * @param {Array} filters additional query filters * @return {Object} */ -export function getQueryParams(mappings, type, search, searchFields, extraQueryParams = {}) { - if (!type && !search) { - return {}; - } +export function getQueryParams(mappings, type, search, searchFields, filters = []) { - const bool = {}; + const bool = { + filter: [...filters], + }; if (type) { - bool.filter = [{ [Array.isArray(type) ? 'terms' : 'term']: { type } }]; + bool.filter.push({ [Array.isArray(type) ? 'terms' : 'term']: { type } }); } if (search) { bool.must = [ - ...bool.must || [], { simple_query_string: { query: search, @@ -95,35 +92,12 @@ export function getQueryParams(mappings, type, search, searchFields, extraQueryP ]; } - // a list of fields to manually merge together - const fieldsToMerge = ['filter', 'must']; - - const extraParams = { - ...extraQueryParams.bool - }; - - // Remove the manual merge fields from the collection of properties we will automatically combine. - fieldsToMerge.forEach(field => delete extraParams[field]); - - let query = { - bool: defaultsDeep(bool, extraParams) - }; - - if (extraQueryParams.bool) { - - const extraBoolParams = extraQueryParams.bool; - - query = fieldsToMerge.reduce((queryAcc, field) => { - const prop = queryAcc.bool[field]; - const extraProp = extraBoolParams[field]; - if (Array.isArray(prop) && Array.isArray(extraProp)) { - queryAcc.bool[field] = [...prop, ...extraProp]; - } - return queryAcc; - }, query); + // Don't construct a query if there is nothing to search on. + if (bool.filter.length === 0 && !search) { + return {}; } - return { query }; + return { query: { bool } }; } diff --git a/src/server/saved_objects/service/lib/search_dsl/query_params.test.js b/src/server/saved_objects/service/lib/search_dsl/query_params.test.js index 2a1ac85181605..e3e261db1e77e 100644 --- a/src/server/saved_objects/service/lib/search_dsl/query_params.test.js +++ b/src/server/saved_objects/service/lib/search_dsl/query_params.test.js @@ -64,7 +64,7 @@ describe('searchDsl/queryParams', () => { }); describe('{type}', () => { - it('adds a term filter when a string', () => { + it('includes just a terms filter', () => { expect(getQueryParams(MAPPINGS, 'saved')) .toEqual({ query: { @@ -78,15 +78,18 @@ describe('searchDsl/queryParams', () => { } }); }); + }); - it('adds a terms filter when an array', () => { - expect(getQueryParams(MAPPINGS, ['saved', 'vis'])) + describe('{type,filters}', () => { + it('includes filters and a term filter for type', () => { + expect(getQueryParams(MAPPINGS, 'saved', null, null, [{ terms: { foo: ['bar', 'baz'] } }])) .toEqual({ query: { bool: { filter: [ + { terms: { foo: ['bar', 'baz'] } }, { - terms: { type: ['saved', 'vis'] } + term: { type: 'saved' } } ] } @@ -101,6 +104,30 @@ describe('searchDsl/queryParams', () => { .toEqual({ query: { bool: { + filter: [], + must: [ + { + simple_query_string: { + query: 'us*', + all_fields: true + } + } + ] + } + } + }); + }); + }); + + describe('{search,filters}', () => { + it('includes filters and a sqs query', () => { + expect(getQueryParams(MAPPINGS, null, 'us*', null, [{ terms: { foo: ['bar', 'baz'] } }])) + .toEqual({ + query: { + bool: { + filter: [ + { terms: { foo: ['bar', 'baz'] } } + ], must: [ { simple_query_string: { @@ -136,13 +163,17 @@ describe('searchDsl/queryParams', () => { } }); }); - it('includes bool with sqs query and terms filter for type', () => { - expect(getQueryParams(MAPPINGS, ['saved', 'vis'], 'y*')) + }); + + describe('{type,search,filters}', () => { + it('includes bool with sqs query, filters and term filter for type', () => { + expect(getQueryParams(MAPPINGS, 'saved', 'y*', null, [{ terms: { foo: ['bar', 'baz'] } }])) .toEqual({ query: { bool: { filter: [ - { terms: { type: ['saved', 'vis'] } } + { terms: { foo: ['bar', 'baz'] } }, + { term: { type: 'saved' } } ], must: [ { @@ -164,6 +195,7 @@ describe('searchDsl/queryParams', () => { .toEqual({ query: { bool: { + filter: [], must: [ { simple_query_string: { @@ -184,6 +216,7 @@ describe('searchDsl/queryParams', () => { .toEqual({ query: { bool: { + filter: [], must: [ { simple_query_string: { @@ -204,6 +237,7 @@ describe('searchDsl/queryParams', () => { .toEqual({ query: { bool: { + filter: [], must: [ { simple_query_string: { @@ -223,20 +257,21 @@ describe('searchDsl/queryParams', () => { }); }); - describe('{type,search,searchFields}', () => { - it('includes bool, with term filter and sqs with field list', () => { - expect(getQueryParams(MAPPINGS, 'saved', 'y*', ['title'])) + describe('{search,searchFields,filters}', () => { + it('specifies filters and includes all types for field', () => { + expect(getQueryParams(MAPPINGS, null, 'y*', ['title'], [{ terms: { foo: ['bar', 'baz'] } }])) .toEqual({ query: { bool: { filter: [ - { term: { type: 'saved' } } + { terms: { foo: ['bar', 'baz'] } }, ], must: [ { simple_query_string: { query: 'y*', fields: [ + 'pending.title', 'saved.title' ] } @@ -246,21 +281,71 @@ describe('searchDsl/queryParams', () => { } }); }); - it('includes bool, with terms filter and sqs with field list', () => { - expect(getQueryParams(MAPPINGS, ['saved', 'vis'], 'y*', ['title'])) + it('specifies filters and supports field boosting', () => { + expect(getQueryParams(MAPPINGS, null, 'y*', ['title^3'], [{ terms: { foo: ['bar', 'baz'] } }])) .toEqual({ query: { bool: { filter: [ - { terms: { type: ['saved', 'vis'] } } + { terms: { foo: ['bar', 'baz'] } }, ], must: [ { simple_query_string: { query: 'y*', fields: [ + 'pending.title^3', + 'saved.title^3' + ] + } + } + ] + } + } + }); + }); + it('specifies filters and supports field and multi-field', () => { + expect(getQueryParams(MAPPINGS, null, 'y*', ['title', 'title.raw'], [{ terms: { foo: ['bar', 'baz'] } }])) + .toEqual({ + query: { + bool: { + filter: [ + { terms: { foo: ['bar', 'baz'] } }, + ], + must: [ + { + simple_query_string: { + query: 'y*', + fields: [ + 'pending.title', 'saved.title', - 'vis.title' + 'pending.title.raw', + 'saved.title.raw', + ] + } + } + ] + } + } + }); + }); + }); + + describe('{type,search,searchFields}', () => { + it('includes bool, and sqs with field list', () => { + expect(getQueryParams(MAPPINGS, 'saved', 'y*', ['title'])) + .toEqual({ + query: { + bool: { + filter: [ + { term: { type: 'saved' } } + ], + must: [ + { + simple_query_string: { + query: 'y*', + fields: [ + 'saved.title' ] } } @@ -316,75 +401,76 @@ describe('searchDsl/queryParams', () => { }); }); - describe('{extraQueryParams}', () => { - it('merges the extraQueryParams into the generated query params', () => { - const baseQueryParams = getQueryParams(MAPPINGS, 'saved', 'search'); - expect(baseQueryParams) + describe('{type,search,searchFields,filters}', () => { + it('includes specified filters, type filter and sqs with field list', () => { + expect(getQueryParams(MAPPINGS, 'saved', 'y*', ['title'], [{ terms: { foo: ['bar', 'baz'] } }])) .toEqual({ query: { bool: { filter: [ + { terms: { foo: ['bar', 'baz'] } }, + { term: { type: 'saved' } } + ], + must: [ { - term: { type: 'saved' } + simple_query_string: { + query: 'y*', + fields: [ + 'saved.title' + ] + } } + ] + } + } + }); + }); + it('supports fields pointing to multi-fields', () => { + expect(getQueryParams(MAPPINGS, 'saved', 'y*', ['title.raw'], [{ terms: { foo: ['bar', 'baz'] } }])) + .toEqual({ + query: { + bool: { + filter: [ + { terms: { foo: ['bar', 'baz'] } }, + { term: { type: 'saved' } } ], - must: [{ - simple_query_string: { - all_fields: true, - query: 'search' + must: [ + { + simple_query_string: { + query: 'y*', + fields: [ + 'saved.title.raw' + ] + } } - }] + ] } } }); - - const result = getQueryParams(MAPPINGS, 'saved', 'search', null, { - bool: { - filter: [{ - term: { type: 'foo' } - }], - must: [{ - term: { - someField: 'bar' - } - }], - must_not: [{ - term: { - field1: 'value' + }); + it('supports multiple search fields', () => { + expect(getQueryParams(MAPPINGS, 'saved', 'y*', ['title', 'title.raw'], [{ terms: { foo: ['bar', 'baz'] } }])) + .toEqual({ + query: { + bool: { + filter: [ + { terms: { foo: ['bar', 'baz'] } }, + { term: { type: 'saved' } } + ], + must: [ + { + simple_query_string: { + query: 'y*', + fields: [ + 'saved.title', + 'saved.title.raw' + ] + } + } + ] } - }] - } - }); - - expect(result).toEqual({ - query: { - bool: { - filter: [ - { - term: { type: 'saved' } - }, - { - term: { type: 'foo' } - } - ], - must: [{ - simple_query_string: { - all_fields: true, - query: 'search' - } - }, { - term: { - someField: 'bar' - } - }], - must_not: [{ - term: { - field1: 'value' - } - }] } - } - }); + }); }); }); }); diff --git a/src/server/saved_objects/service/lib/search_dsl/search_dsl.js b/src/server/saved_objects/service/lib/search_dsl/search_dsl.js index 270473ada36bd..94f938c921ed0 100644 --- a/src/server/saved_objects/service/lib/search_dsl/search_dsl.js +++ b/src/server/saved_objects/service/lib/search_dsl/search_dsl.js @@ -29,7 +29,7 @@ export function getSearchDsl(mappings, options = {}) { searchFields, sortField, sortOrder, - extraQueryParams, + filters, } = options; if (!type && sortField) { @@ -40,12 +40,12 @@ export function getSearchDsl(mappings, options = {}) { throw Boom.notAcceptable('sortOrder requires a sortField'); } - if (extraQueryParams && typeof extraQueryParams !== 'object') { - throw Boom.notAcceptable('extraQueryParams must be an object'); + if (filters && !Array.isArray(filters)) { + throw Boom.notAcceptable('filters must be an array'); } return { - ...getQueryParams(mappings, type, search, searchFields, extraQueryParams), + ...getQueryParams(mappings, type, search, searchFields, filters), ...getSortingParams(mappings, type, sortField, sortOrder), }; } diff --git a/src/server/saved_objects/service/lib/search_dsl/search_dsl.test.js b/src/server/saved_objects/service/lib/search_dsl/search_dsl.test.js index b21b127d51b10..6ed40a7929dcf 100644 --- a/src/server/saved_objects/service/lib/search_dsl/search_dsl.test.js +++ b/src/server/saved_objects/service/lib/search_dsl/search_dsl.test.js @@ -46,14 +46,14 @@ describe('getSearchDsl', () => { }); describe('passes control', () => { - it('passes (mappings, type, search, searchFields, extraQueryParams) to getQueryParams', () => { + it('passes (mappings, type, search, searchFields, filters) to getQueryParams', () => { const spy = sandbox.spy(queryParamsNS, 'getQueryParams'); const mappings = { type: { properties: {} } }; const opts = { type: 'foo', search: 'bar', searchFields: ['baz'], - extraQueryParams: { bool: {} }, + filters: [{ bool: {} }], }; getSearchDsl(mappings, opts); @@ -64,7 +64,7 @@ describe('getSearchDsl', () => { opts.type, opts.search, opts.searchFields, - opts.extraQueryParams, + opts.filters, ); }); diff --git a/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.js b/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.js index c117423985536..e6d3ec387d8a6 100644 --- a/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.js +++ b/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.js @@ -46,17 +46,19 @@ function getClauseForType(spaceId, type) { }; } -export function getSpacesQueryParams(spaceId, types = []) { +export function getSpacesQueryFilters(spaceId, types = []) { + const filters = []; + const typeClauses = types.map((type) => getClauseForType(spaceId, type)); if (typeClauses.length > 0) { - return { + filters.push({ bool: { should: typeClauses, minimum_should_match: 1 } - }; + }); } - return {}; + return filters; } diff --git a/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.test.js b/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.test.js index 520ebebc33735..0463a2aaac533 100644 --- a/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.test.js +++ b/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.test.js @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getSpacesQueryParams } from './query_params'; +import { getSpacesQueryFilters } from './query_params'; test('returns no parameters when no types are provided', () => { - expect(getSpacesQueryParams('space_1', [])).toEqual({}); + expect(getSpacesQueryFilters('space_1', [])).toEqual([]); }); test('creates a query that filters on type, but not on space, for types that are not space-aware', () => { @@ -23,12 +23,12 @@ test('creates a query that filters on type, but not on space, for types that are }] } }; - expect(getSpacesQueryParams(spaceId, [type])).toEqual({ + expect(getSpacesQueryFilters(spaceId, [type])).toEqual([{ bool: { should: [expectedTypeClause], minimum_should_match: 1 } - }); + }]); }); test('creates a query that restricts a space-aware type to the provided space (space_1)', () => { @@ -49,12 +49,12 @@ test('creates a query that restricts a space-aware type to the provided space (s } }; - expect(getSpacesQueryParams(spaceId, [type])).toEqual({ + expect(getSpacesQueryFilters(spaceId, [type])).toEqual([{ bool: { should: [expectedTypeClause], minimum_should_match: 1 } - }); + }]); }); test('creates a query that restricts a space-aware type to the provided space (default)', () => { @@ -78,12 +78,12 @@ test('creates a query that restricts a space-aware type to the provided space (d } }; - expect(getSpacesQueryParams(spaceId, [type])).toEqual({ + expect(getSpacesQueryFilters(spaceId, [type])).toEqual([{ bool: { should: [expectedTypeClause], minimum_should_match: 1 } - }); + }]); }); test('creates a query supporting a find operation on multiple types', () => { @@ -126,10 +126,10 @@ test('creates a query supporting a find operation on multiple types', () => { } }]; - expect(getSpacesQueryParams(spaceId, types)).toEqual({ + expect(getSpacesQueryFilters(spaceId, types)).toEqual([{ bool: { should: expectedTypeClauses, minimum_should_match: 1 } - }); + }]); }); diff --git a/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js b/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js index 96c00c710debc..7b4ead075db12 100644 --- a/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js +++ b/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js @@ -6,7 +6,7 @@ import { DEFAULT_SPACE_ID } from '../../../common/constants'; import { isTypeSpaceAware } from './lib/is_type_space_aware'; -import { getSpacesQueryParams } from './lib/query_params'; +import { getSpacesQueryFilters } from './lib/query_params'; export class SpacesSavedObjectsClient { constructor(options) { @@ -77,7 +77,7 @@ export class SpacesSavedObjectsClient { const spaceId = await this._getSpaceId(); - spaceOptions.extraQueryParams = getSpacesQueryParams(spaceId, types); + spaceOptions.filters = getSpacesQueryFilters(spaceId, types); return await this._client.find({ ...options, ...spaceOptions }); } @@ -91,7 +91,7 @@ export class SpacesSavedObjectsClient { }); result.saved_objects = result.saved_objects.map(savedObject => { - const { id, type, spaceId } = savedObject; + const { id, type, spaceId = DEFAULT_SPACE_ID } = savedObject; if (isTypeSpaceAware(type)) { if (spaceId !== thisSpaceId) { From 452de107a41dc896059a133e030a9e6886f9d3a4 Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Fri, 29 Jun 2018 15:31:26 -0400 Subject: [PATCH 2/3] don't add space id when updating within the default space --- .../spaces_saved_objects_client.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js b/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js index 7b4ead075db12..7cddc93a769f0 100644 --- a/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js +++ b/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js @@ -134,10 +134,13 @@ export class SpacesSavedObjectsClient { if (isTypeSpaceAware(type)) { await this.get(type, id); - options.extraBodyProperties = { - ...options.extraBodyProperties, - spaceId: await this._getSpaceId() - }; + const spaceId = await this._getSpaceId(); + if (spaceId !== DEFAULT_SPACE_ID) { + options.extraBodyProperties = { + ...options.extraBodyProperties, + spaceId + }; + } } return await this._client.update(type, id, attributes, options); From 6bf3515209ae318c7b36082d59ad9b7060f9d1a6 Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Fri, 29 Jun 2018 15:37:43 -0400 Subject: [PATCH 3/3] renaming files --- .../lib/{query_params.js => query_filters.js} | 0 .../lib/{query_params.test.js => query_filters.test.js} | 2 +- .../lib/saved_objects_client/spaces_saved_objects_client.js | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename x-pack/plugins/spaces/server/lib/saved_objects_client/lib/{query_params.js => query_filters.js} (100%) rename x-pack/plugins/spaces/server/lib/saved_objects_client/lib/{query_params.test.js => query_filters.test.js} (97%) diff --git a/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.js b/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_filters.js similarity index 100% rename from x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.js rename to x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_filters.js diff --git a/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.test.js b/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_filters.test.js similarity index 97% rename from x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.test.js rename to x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_filters.test.js index 0463a2aaac533..a332065e76273 100644 --- a/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_params.test.js +++ b/x-pack/plugins/spaces/server/lib/saved_objects_client/lib/query_filters.test.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getSpacesQueryFilters } from './query_params'; +import { getSpacesQueryFilters } from './query_filters'; test('returns no parameters when no types are provided', () => { expect(getSpacesQueryFilters('space_1', [])).toEqual([]); diff --git a/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js b/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js index 7cddc93a769f0..96b0baef9360d 100644 --- a/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js +++ b/x-pack/plugins/spaces/server/lib/saved_objects_client/spaces_saved_objects_client.js @@ -6,7 +6,7 @@ import { DEFAULT_SPACE_ID } from '../../../common/constants'; import { isTypeSpaceAware } from './lib/is_type_space_aware'; -import { getSpacesQueryFilters } from './lib/query_params'; +import { getSpacesQueryFilters } from './lib/query_filters'; export class SpacesSavedObjectsClient { constructor(options) {