Skip to content

Commit

Permalink
Change mapping of index-pattern fields to text (#9353)
Browse files Browse the repository at this point in the history
* Change mapping of index-pattern fields to text

* Update kibana index mappings from keyword to text to allow longer values

* Update search source to text mapping instead of keyword

* fix mapping setup test

* Change from string to text
  • Loading branch information
lukasolson authored Dec 7, 2016
1 parent e1428f7 commit 0a577f1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ module.factory('SavedDashboard', function (courier, config) {
title: 'text',
hits: 'integer',
description: 'text',
panelsJSON: 'keyword',
optionsJSON: 'keyword',
uiStateJSON: 'keyword',
panelsJSON: 'text',
optionsJSON: 'text',
uiStateJSON: 'text',
version: 'integer',
timeRestore: 'boolean',
timeTo: 'keyword',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ uiModules
SavedVis.mapping = {
title: 'text',
visState: 'json',
uiStateJSON: 'keyword',
uiStateJSON: 'text',
description: 'text',
savedSearchId: 'keyword',
version: 'integer'
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/timelion/public/services/_saved_sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.factory('SavedSheet', function (courier, config) {
title: 'text',
hits: 'integer',
description: 'text',
timelion_sheet: 'keyword',
timelion_sheet: 'text',
timelion_interval: 'keyword',
timelion_other_interval: 'keyword',
timelion_chart_height: '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 @@ -147,7 +147,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: 'keyword'
type: 'text'
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/index_patterns/_index_pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function IndexPatternFactory(Private, Notifier, config, kbnIndex,
fields: 'json',
sourceFilters: 'json',
fieldFormatMap: {
type: 'keyword',
type: 'text',
_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 keyword', function () {
it('returned object is type text', function () {
const mapping = mappingSetup.expandShorthand({ foo: 'json' });
expect(mapping.foo.type).to.be('keyword');
expect(mapping.foo.type).to.be('text');
});

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 = 'keyword';
val.type = 'text';
val._serialize = json._serialize;
val._deserialize = json._deserialize;
}
Expand Down

0 comments on commit 0a577f1

Please sign in to comment.