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

Update mappings for kibana index #9280

Merged
merged 7 commits into from
Dec 2, 2016
Merged
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 @@ -53,9 +53,7 @@ describe('plugins/elasticsearch', function () {
expect(params.body.mappings.config.properties)
.to.have.property('buildNum');
expect(params.body.mappings.config.properties.buildNum)
.to.have.property('type', 'string');
expect(params.body.mappings.config.properties.buildNum)
.to.have.property('index', 'not_analyzed');
.to.have.property('type', 'keyword');
});
});

Expand Down
3 changes: 1 addition & 2 deletions src/core_plugins/elasticsearch/lib/kibana_index_mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ export const mappings = {
config: {
properties: {
buildNum: {
type: 'string',
index: 'not_analyzed'
type: 'keyword'
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@ module.factory('SavedDashboard', function (courier, config) {

// if type:dashboard has no mapping, we push this mapping into ES
SavedDashboard.mapping = {
title: 'string',
title: 'text',
hits: 'integer',
description: 'string',
panelsJSON: 'string',
optionsJSON: 'string',
uiStateJSON: 'string',
description: 'text',
panelsJSON: 'keyword',
optionsJSON: 'keyword',
uiStateJSON: 'keyword',
version: 'integer',
timeRestore: 'boolean',
timeTo: 'string',
timeFrom: 'string',
timeTo: 'keyword',
timeFrom: 'keyword',
refreshInterval: {
type: 'object',
properties: {
display: {type: 'string'},
display: {type: 'keyword'},
pause: { type: 'boolean'},
section: { type: 'integer'},
value: { type: 'integer'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ module.factory('SavedSearch', function (courier) {
SavedSearch.type = 'search';

SavedSearch.mapping = {
title: 'string',
description: 'string',
title: 'text',
description: 'text',
hits: 'integer',
columns: 'string',
sort: 'string',
columns: 'keyword',
sort: 'keyword',
version: 'integer'
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ uiModules
SavedVis.type = 'visualization';

SavedVis.mapping = {
title: 'string',
title: 'text',
visState: 'json',
uiStateJSON: 'string',
description: 'string',
savedSearchId: 'string',
uiStateJSON: 'keyword',
description: 'text',
savedSearchId: 'keyword',
version: 'integer'
};

Expand Down

This file was deleted.

50 changes: 0 additions & 50 deletions src/core_plugins/kibana/server/lib/init_default_field_props.js

This file was deleted.

38 changes: 0 additions & 38 deletions src/core_plugins/kibana/server/lib/mapping_overrides.js

This file was deleted.

10 changes: 5 additions & 5 deletions src/core_plugins/timelion/public/services/_saved_sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ module.factory('SavedSheet', function (courier, config) {

// if type:sheet has no mapping, we push this mapping into ES
SavedSheet.mapping = {
title: 'string',
title: 'text',
hits: 'integer',
description: 'string',
timelion_sheet: 'string',
timelion_interval: 'string',
timelion_other_interval: 'string',
description: 'text',
timelion_sheet: 'keyword',
timelion_interval: 'keyword',
timelion_other_interval: 'keyword',
timelion_chart_height: 'integer',
timelion_columns: 'integer',
timelion_rows: 'integer',
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/courier/saved_object/saved_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function SavedObjectFactory(es, kbnIndex, Promise, Private, Notif
properties: {
// setup the searchSource mapping, even if it is not used but this type yet
searchSourceJSON: {
type: 'string'
type: 'keyword'
}
}
};
Expand Down
8 changes: 4 additions & 4 deletions src/ui/public/index_patterns/_index_pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ export default function IndexPatternFactory(Private, Notifier, config, kbnIndex,
});

const mapping = mappingSetup.expandShorthand({
title: 'string',
timeFieldName: 'string',
title: 'text',
timeFieldName: 'keyword',
notExpandable: 'boolean',
intervalName: 'string',
intervalName: 'keyword',
fields: 'json',
sourceFilters: 'json',
fieldFormatMap: {
type: 'string',
type: 'keyword',
_serialize(map = {}) {
const serialized = _.transform(map, serialize);
return _.isEmpty(serialized) ? undefined : angular.toJson(serialized);
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/utils/__tests__/mapping_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ describe('ui/utils/mapping_setup', function () {
});

context('when type is json', function () {
it('returned object is type string', function () {
it('returned object is type keyword', function () {
const mapping = mappingSetup.expandShorthand({ foo: 'json' });
expect(mapping.foo.type).to.be('string');
expect(mapping.foo.type).to.be('keyword');
});

it('returned object has _serialize function', function () {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/utils/mapping_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ define(function () {
if (typeof val === 'string') val = { type: val };

if (val.type === 'json') {
val.type = 'string';
val.type = 'keyword';
val._serialize = json._serialize;
val._deserialize = json._deserialize;
}
Expand Down