Skip to content

Commit

Permalink
Remove support for deprecated multi_field type in Console. (elastic#4…
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal authored Aug 7, 2019
1 parent 1681f78 commit 49ffd4e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
8 changes: 0 additions & 8 deletions src/legacy/core_plugins/console/public/src/mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,6 @@ function getFieldNamesFromFieldMapping(fieldName, fieldMapping) {

const fieldType = fieldMapping.type;

if (fieldType === 'multi_field') {
nestedFields = $.map(fieldMapping.fields, function (fieldMapping, fieldName) {
return getFieldNamesFromFieldMapping(fieldName, fieldMapping);
});

return applyPathSettings(nestedFields);
}

const ret = { name: fieldName, type: fieldType };

if (fieldMapping.index_name) {
Expand Down
31 changes: 0 additions & 31 deletions src/legacy/core_plugins/console/public/tests/src/mapping.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,6 @@ describe('Mappings', () => {
return { name: name, type: type || 'string' };
}

test('Multi fields', function () {
mappings.loadMappings({
index: {
properties: {
first_name: {
type: 'multi_field',
path: 'just_name',
fields: {
first_name: { type: 'string', index: 'analyzed' },
any_name: { type: 'string', index: 'analyzed' },
},
},
last_name: {
type: 'multi_field',
path: 'just_name',
fields: {
last_name: { type: 'string', index: 'analyzed' },
any_name: { type: 'string', index: 'analyzed' },
},
},
},
},
});

expect(mappings.getFields('index').sort(fc)).toEqual([
f('any_name', 'string'),
f('first_name', 'string'),
f('last_name', 'string'),
]);
});

test('Multi fields 1.0 style', function () {
mappings.loadMappings({
index: {
Expand Down

0 comments on commit 49ffd4e

Please sign in to comment.