Skip to content

Commit

Permalink
Treat constant_keyword as string in kibana index patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
skh committed Apr 30, 2020
1 parent f0cd093 commit d4822a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ describe('creating index patterns from yaml fields', () => {
{ fields: [{ name: 'testField', type: 'text' }], expect: 'string' },
{ fields: [{ name: 'testField', type: 'date' }], expect: 'date' },
{ fields: [{ name: 'testField', type: 'geo_point' }], expect: 'geo_point' },
{ fields: [{ name: 'testField', type: 'constant_keyword' }], expect: 'string' },
];

tests.forEach(test => {
Expand Down Expand Up @@ -191,6 +192,7 @@ describe('creating index patterns from yaml fields', () => {
attr: 'aggregatable',
},
{ fields: [{ name, type: 'keyword' }], expect: true, attr: 'aggregatable' },
{ fields: [{ name, type: 'constant_keyword' }], expect: true, attr: 'aggregatable' },
{ fields: [{ name, type: 'text', aggregatable: true }], expect: false, attr: 'aggregatable' },
{ fields: [{ name, type: 'text' }], expect: false, attr: 'aggregatable' },
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const typeMap: TypeMap = {
date: 'date',
ip: 'ip',
boolean: 'boolean',
constant_keyword: 'string',
};

export interface IndexPatternField {
Expand Down

0 comments on commit d4822a8

Please sign in to comment.