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

Change mapping of index-pattern fields to text #9353

Merged
merged 6 commits into from
Dec 7, 2016
Merged
Show file tree
Hide file tree
Changes from 5 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 @@ -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: 'string'
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be text?

Copy link
Member Author

Choose a reason for hiding this comment

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

GAH sorry

}
}
};
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