Skip to content

Commit

Permalink
remove types
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Oct 22, 2019
1 parent 7a01cbc commit 9fb5342
Show file tree
Hide file tree
Showing 26 changed files with 12 additions and 81 deletions.
33 changes: 0 additions & 33 deletions src/core/server/saved_objects/service/lib/repository.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ describe('SavedObjectsRepository', () => {
hits: [
{
_index: '.kibana',
_type: '_doc',
_id: 'index-pattern:logstash-*',
_score: 1,
...mockVersionProps,
Expand All @@ -65,7 +64,6 @@ describe('SavedObjectsRepository', () => {
},
{
_index: '.kibana',
_type: '_doc',
_id: 'config:6.0.0-alpha1',
_score: 1,
...mockVersionProps,
Expand All @@ -80,7 +78,6 @@ describe('SavedObjectsRepository', () => {
},
{
_index: '.kibana',
_type: '_doc',
_id: 'index-pattern:stocks-*',
_score: 1,
...mockVersionProps,
Expand All @@ -96,7 +93,6 @@ describe('SavedObjectsRepository', () => {
},
{
_index: '.kibana',
_type: '_doc',
_id: 'globaltype:something',
_score: 1,
...mockVersionProps,
Expand All @@ -118,7 +114,6 @@ describe('SavedObjectsRepository', () => {
hits: [
{
_index: '.kibana',
_type: '_doc',
_id: 'foo-namespace:index-pattern:logstash-*',
_score: 1,
...mockVersionProps,
Expand All @@ -135,7 +130,6 @@ describe('SavedObjectsRepository', () => {
},
{
_index: '.kibana',
_type: '_doc',
_id: 'foo-namespace:config:6.0.0-alpha1',
_score: 1,
...mockVersionProps,
Expand All @@ -151,7 +145,6 @@ describe('SavedObjectsRepository', () => {
},
{
_index: '.kibana',
_type: '_doc',
_id: 'foo-namespace:index-pattern:stocks-*',
_score: 1,
...mockVersionProps,
Expand All @@ -168,7 +161,6 @@ describe('SavedObjectsRepository', () => {
},
{
_index: '.kibana',
_type: '_doc',
_id: 'globaltype:something',
_score: 1,
...mockVersionProps,
Expand Down Expand Up @@ -290,7 +282,6 @@ describe('SavedObjectsRepository', () => {
describe('#create', () => {
beforeEach(() => {
callAdminCluster.mockImplementation((method, params) => ({
_type: '_doc',
_id: params.id,
...mockVersionProps,
}));
Expand Down Expand Up @@ -760,7 +751,6 @@ describe('SavedObjectsRepository', () => {
items: [
{
create: {
_type: '_doc',
_id: 'config:one',
error: {
reason: 'type[config] missing',
Expand All @@ -769,7 +759,6 @@ describe('SavedObjectsRepository', () => {
},
{
create: {
_type: '_doc',
_id: 'index-pattern:two',
...mockVersionProps,
},
Expand Down Expand Up @@ -807,14 +796,12 @@ describe('SavedObjectsRepository', () => {
items: [
{
create: {
_type: '_doc',
_id: 'config:one',
...mockVersionProps,
},
},
{
create: {
_type: '_doc',
_id: 'index-pattern:two',
...mockVersionProps,
},
Expand Down Expand Up @@ -859,7 +846,6 @@ describe('SavedObjectsRepository', () => {
items: [
{
create: {
_type: '_doc',
_id: 'foo-namespace:config:one',
_index: '.kibana-test',
_primary_term: 1,
Expand All @@ -868,7 +854,6 @@ describe('SavedObjectsRepository', () => {
},
{
create: {
_type: '_doc',
_id: 'foo-namespace:index-pattern:two',
_primary_term: 1,
_seq_no: 2,
Expand Down Expand Up @@ -918,14 +903,12 @@ describe('SavedObjectsRepository', () => {
items: [
{
create: {
_type: '_doc',
_id: 'config:one',
...mockVersionProps,
},
},
{
create: {
_type: '_doc',
_id: 'index-pattern:two',
...mockVersionProps,
},
Expand Down Expand Up @@ -1351,7 +1334,6 @@ describe('SavedObjectsRepository', () => {
describe('#get', () => {
const noNamespaceResult = {
_id: 'index-pattern:logstash-*',
_type: '_doc',
...mockVersionProps,
_source: {
type: 'index-pattern',
Expand All @@ -1364,7 +1346,6 @@ describe('SavedObjectsRepository', () => {
};
const namespacedResult = {
_id: 'foo-namespace:index-pattern:logstash-*',
_type: '_doc',
...mockVersionProps,
_source: {
namespace: 'foo-namespace',
Expand Down Expand Up @@ -1554,14 +1535,12 @@ describe('SavedObjectsRepository', () => {
callAdminCluster.mockResolvedValue({
docs: [
{
_type: '_doc',
_id: 'config:good',
found: true,
...mockVersionProps,
_source: { ...mockTimestampFields, config: { title: 'Test' } },
},
{
_type: '_doc',
_id: 'config:bad',
found: false,
},
Expand All @@ -1583,14 +1562,12 @@ describe('SavedObjectsRepository', () => {
callAdminCluster.mockResolvedValue({
docs: [
{
_type: '_doc',
_id: 'config:good',
found: true,
...mockVersionProps,
_source: { ...mockTimestampFields, config: { title: 'Test' } },
},
{
_type: '_doc',
_id: 'config:bad',
found: false,
},
Expand Down Expand Up @@ -1625,21 +1602,18 @@ describe('SavedObjectsRepository', () => {
callAdminCluster.mockResolvedValue({
docs: [
{
_type: '_doc',
_id: 'one',
found: true,
...mockVersionProps,
_source: { ...mockTimestampFields, config: { title: 'Test1' } },
},
{
_type: '_doc',
_id: 'three',
found: true,
...mockVersionProps,
_source: { ...mockTimestampFields, config: { title: 'Test3' } },
},
{
_type: '_doc',
_id: 'five',
found: true,
...mockVersionProps,
Expand Down Expand Up @@ -1714,7 +1688,6 @@ describe('SavedObjectsRepository', () => {
beforeEach(() => {
callAdminCluster.mockResolvedValue({
_id: `${type}:${id}`,
_type: '_doc',
...mockVersionProps,
result: 'updated',
});
Expand Down Expand Up @@ -1998,7 +1971,6 @@ describe('SavedObjectsRepository', () => {
items: objects.map(items => ({
update: {
_id: `${items.type}:${items.id}`,
_type: '_doc',
...mockVersionProps,
result: 'updated',
}
Expand Down Expand Up @@ -2073,7 +2045,6 @@ describe('SavedObjectsRepository', () => {
return ({
update: {
_id: `${items.type}:${items.id}`,
_type: '_doc',
error: {
type: 'version_conflict_engine_exception'
}
Expand All @@ -2083,7 +2054,6 @@ describe('SavedObjectsRepository', () => {
return ({
update: {
_id: `${items.type}:${items.id}`,
_type: '_doc',
...mockVersionProps,
result: 'updated',
}
Expand Down Expand Up @@ -2420,7 +2390,6 @@ describe('SavedObjectsRepository', () => {
describe('#incrementCounter', () => {
beforeEach(() => {
callAdminCluster.mockImplementation((method, params) => ({
_type: '_doc',
_id: params.id,
...mockVersionProps,
_index: '.kibana',
Expand All @@ -2440,7 +2409,6 @@ describe('SavedObjectsRepository', () => {

it('formats Elasticsearch response', async () => {
callAdminCluster.mockImplementation((method, params) => ({
_type: '_doc',
_id: params.id,
...mockVersionProps,
_index: '.kibana',
Expand Down Expand Up @@ -2536,7 +2504,6 @@ describe('SavedObjectsRepository', () => {

it(`doesn't prepend namespace to the id or add namespace property when providing namespace for namespace agnostic type`, async () => {
callAdminCluster.mockImplementation((method, params) => ({
_type: '_doc',
_id: params.id,
...mockVersionProps,
_index: '.kibana',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const recordsToBulkBody = records => {

return [
...acc,
{ index: { _index: index, _type: type, _id: id } },
{ index: { _index: index, _id: id } },
source
];
}, []);
Expand Down
1 change: 0 additions & 1 deletion src/es_archiver/lib/indices/kibana_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ export async function cleanKibanaIndices({ client, stats, log, kibanaPluginIds }
export async function createDefaultSpace({ index, client }) {
await client.create({
index,
type: '_doc',
id: 'space:default',
ignore: 409,
body: {
Expand Down
1 change: 0 additions & 1 deletion src/fixtures/fake_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export function getFakeRow(id, mapping) {
_id: id,
_index: 'test',
_source: getFakeRowVals('original', id, mapping),
_type: 'doc',
sort: [id],
};
}
1 change: 0 additions & 1 deletion src/fixtures/hits.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default function fitsFixture() {
return {
_score: 1,
_id: 1000 + i,
_type: 'test',
_index: 'test-index',
_source: {
'@timestamp': row[0],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ describe('ObjectsTable', () => {

const mockSavedObjects = mockSelectedSavedObjects.map(obj => ({
_id: obj.id,
_type: obj._type,
_source: {},
}));

Expand Down Expand Up @@ -297,7 +296,6 @@ describe('ObjectsTable', () => {

const mockSavedObjects = mockSelectedSavedObjects.map(obj => ({
_id: obj.id,
_type: obj._type,
_source: {},
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ function setupMockCallCluster(optCount, language) {
if (optCount === null) {
return Promise.resolve({
_index: '.kibana_1',
_type: 'doc',
_id: 'kql-telemetry:kql-telemetry',
found: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export function registerScrollForExportRoute(server) {
const type = hit.type;
return {
_id: hit.id,
_type: type,
_source: hit.attributes,
_meta: {
savedObjectVersion: 2
Expand Down
2 changes: 0 additions & 2 deletions test/functional/apps/management/_handle_version_conflict.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.settings.setScriptedFieldScript(`doc['bytes'].value`);
const response = await es.update({
index: '.kibana',
type: '_doc',
id: 'index-pattern:logstash-*',
body: {
'doc': { 'index-pattern': { 'fieldFormatMap': '{"geo.src":{"id":"number"}}' } }
Expand All @@ -83,7 +82,6 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.settings.setFieldFormat('url');
const response = await es.update({
index: '.kibana',
type: '_doc',
id: 'index-pattern:logstash-*',
body: {
'doc': { 'index-pattern': { 'fieldFormatMap': '{"geo.dest":{"id":"number"}}' } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const esResponse = {
hits: [
{
_index: 'apm-7.0.0-alpha1-error-2018.04.25',
_type: 'doc',
_id: 'qH7C_WIBcmGuKeCHJvvT',
_score: null,
_source: {
Expand Down Expand Up @@ -61,7 +60,6 @@ export const esResponse = {
hits: [
{
_index: 'apm-7.0.0-alpha1-error-2018.04.25',
_type: 'doc',
_id: '_3_D_WIBcmGuKeCHFwOW',
_score: null,
_source: {
Expand Down Expand Up @@ -93,7 +91,6 @@ export const esResponse = {
hits: [
{
_index: 'apm-7.0.0-alpha1-error-2018.04.25',
_type: 'doc',
_id: 'dn_D_WIBcmGuKeCHQgXJ',
_score: null,
_source: {
Expand Down Expand Up @@ -125,7 +122,6 @@ export const esResponse = {
hits: [
{
_index: 'apm-7.0.0-alpha1-error-2018.04.25',
_type: 'doc',
_id: 'dX_D_WIBcmGuKeCHQgXJ',
_score: null,
_source: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const searchMocks = {
hits: [
{
_index: '.apm-agent-configuration',
_type: '_doc',
_id: '-aQHsm0BxZLczArvNQYW',
_score: 0.9808292,
_source: {
Expand All @@ -39,7 +38,6 @@ export const searchMocks = {
},
{
_index: '.apm-agent-configuration',
_type: '_doc',
_id: '-KQHsm0BxZLczArvNAb0',
_score: 0.18232156,
_source: {
Expand All @@ -56,7 +54,6 @@ export const searchMocks = {
},
{
_index: '.apm-agent-configuration',
_type: '_doc',
_id: '96QHsm0BxZLczArvNAbD',
_score: 0.0,
_source: {
Expand Down
Loading

0 comments on commit 9fb5342

Please sign in to comment.