Skip to content
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

saved_search: Cleanup saved objects mappings #153129

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"query": "ec6000b775f06f81470df42d23f7a88cb31d64ba",
"rules-settings": "9854495c3b54b16a6625fb250c35e5504da72266",
"sample-data-telemetry": "c38daf1a49ed24f2a4fb091e6e1e833fccf19935",
"search": "01bc42d635e9ea0588741c4c7a2bbd3feb3ac5dc",
"search": "94707713f7831c2eb590700f043af3d9f0e63012",
"search-session": "58a44d14ec991739166b2ec28d718001ab0f4b28",
"search-telemetry": "ab67ef721f294f28d5e10febbd20653347720188",
"security-rule": "1ff82dfb2298c3caf6888fc3ef15c6bf7a628877",
Expand Down
17 changes: 10 additions & 7 deletions src/plugins/saved_search/server/saved_objects/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function getSavedSearchObjectType(
},
},
mappings: {
dynamic: false,
properties: {
columns: { type: 'keyword', index: false, doc_values: false },
description: { type: 'text' },
Expand All @@ -43,31 +44,33 @@ export function getSavedSearchObjectType(
hideAggregatedPreview: { type: 'boolean', index: false, doc_values: false },
hits: { type: 'integer', index: false, doc_values: false },
kibanaSavedObjectMeta: {
dynamic: false,
properties: {
// may need code changes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure what this means -- what code changes may we need?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If your code references any of the fields that could potentially be removed from the mappings, you might need to refactor. So, for example, if you're using sort from savedObjectsAttributes directly, you'd need to refactor to use sort from _source.

searchSourceJSON: { type: 'text', index: false },
},
},
sort: { type: 'keyword', index: false, doc_values: false },
// sort: { type: 'keyword', index: false, doc_values: false },
title: { type: 'text' },
grid: { dynamic: false, properties: {} },
version: { type: 'integer' },
rowHeight: { type: 'text' },
timeRestore: { type: 'boolean', index: false, doc_values: false },
// timeRestore: { type: 'boolean', index: false, doc_values: false },
timeRange: {
dynamic: false,
properties: {
from: { type: 'keyword', index: false, doc_values: false },
to: { type: 'keyword', index: false, doc_values: false },
// from: { type: 'keyword', index: false, doc_values: false },
// to: { type: 'keyword', index: false, doc_values: false },
},
},
refreshInterval: {
dynamic: false,
properties: {
pause: { type: 'boolean', index: false, doc_values: false },
value: { type: 'integer', index: false, doc_values: false },
// pause: { type: 'boolean', index: false, doc_values: false },
// value: { type: 'integer', index: false, doc_values: false },
},
},
rowsPerPage: { type: 'integer', index: false, doc_values: false },
// rowsPerPage: { type: 'integer', index: false, doc_values: false },
breakdownField: { type: 'text' },
},
},
Expand Down