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

Use single ES document type #12794

Merged
merged 62 commits into from
Jul 19, 2017
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
83b33e1
Use single ES document type
Jul 11, 2017
1162898
Merge branch 'master' of github.com:elastic/kibana into single-type
spalger Jul 13, 2017
aaa68b5
Updates type path and sets dynamic to strict
Jul 13, 2017
7e15a38
Resolves tests based on single type
Jul 13, 2017
bb486cc
Removes compatibility layer tests
Jul 13, 2017
2e7d9f7
Remove entire compatibility layer and updates id generation
Jul 13, 2017
986b39b
Use generateEsId and prefix with _
Jul 13, 2017
1b9aa5b
Merge pull request #2 from tylersmalley/single-type-self-uuid
tylersmalley Jul 13, 2017
889097d
create_id_query no longer exists, removing tests
Jul 13, 2017
fd06f0d
Merge remote-tracking branch 'upstream/master' into single-type
Jul 13, 2017
8719e80
Merge branch 'master' of github.com:elastic/kibana into single-type
spalger Jul 14, 2017
d849eb2
[esArchiver] add support to for v6 indices
spalger Jul 14, 2017
5da984c
[tests/functional] rebuild esArchives with v6 indices
spalger Jul 14, 2017
865730b
[ftr/kbnServer] update config doc type/id
spalger Jul 14, 2017
b97fbd7
[savedObject/normalizeEsDoc] only replace `type:` at beginning of id
spalger Jul 14, 2017
13674ad
[server/savedObjects] fix bulkCreate({ overwrite }) param
spalger Jul 14, 2017
8ae6ae9
[server/savedObject] fail faster/less _.get, simplify "normalize"
spalger Jul 14, 2017
27e16bd
[elasticsearch/healthCheck] remove support for v5 index format
spalger Jul 14, 2017
4de377c
[esArchiver] revert changes to esArchiver
spalger Jul 14, 2017
bc35c25
[sever/savedObjectsClient] 💄
spalger Jul 14, 2017
4966669
[elasticsearch/healthCheck/ensureTypes] fix v5 tests
spalger Jul 14, 2017
9759b38
[tests/functional/uiSettings] use SavedObjectsClient
spalger Jul 14, 2017
282b963
Merge branch 'master' of github.com:elastic/kibana into single-type
spalger Jul 14, 2017
c8480dc
[savedObjects/routes] fix validation schemas
spalger Jul 14, 2017
bec9af5
[savedObjects/browserClient] only pass the type once
spalger Jul 14, 2017
adec1fb
Merge branch 'master' of github.com:elastic/kibana into single-type
spalger Jul 14, 2017
45cb298
[savedObjects/routes] fields and searchFields are now casted to array
spalger Jul 14, 2017
bcb4e40
[test/apiIntegration/devServer] remove unsupported param
spalger Jul 14, 2017
2031679
[savedObjects/client] fix browser test
spalger Jul 14, 2017
96e1190
[npm] remove unused package "tmp"
spalger Jul 14, 2017
d85564c
[elasticsearch/ensureTypesExist] read and test with new combined mapp…
spalger Jul 14, 2017
f59a720
[savedObjects/find] require fields and searchFields be arrays
spalger Jul 14, 2017
19b80b9
[indexPatterns] use title for display, not id
spalger Jul 15, 2017
badd28d
[breadcrumbs] move to router, add mapBreadcrumbs route opt
spalger Jul 15, 2017
f6d0b49
[es/migrateConfig] use savedObjectClient factory
spalger Jul 16, 2017
72d8fb5
[server/mappings] make MappingsCollection more generic/testable
spalger Jul 17, 2017
4e78a0f
[server/mappings] use getters to read mappings object
spalger Jul 17, 2017
4b70e93
[savedObjects/client] refactor createFindQuery for better testing/cov…
spalger Jul 17, 2017
6f8d4b0
[server/mappings] IndexMappings represents an index not some mapping …
spalger Jul 17, 2017
f898e1b
[es/healthCheck] stub migrateConfig in tests
spalger Jul 17, 2017
d5104a2
[savedObjects/client] fix tests
spalger Jul 17, 2017
2c4aa76
[server/mappings] add all conflicting props to error
spalger Jul 17, 2017
2c93888
[ui/breadcrumbs] remove tests for remove module
spalger Jul 17, 2017
d5cd567
[ui/savedObjectLoader] undefined* is not a function
spalger Jul 17, 2017
57a708e
[server/mappings] make server responsible for defaults/exposure control
spalger Jul 17, 2017
a8fa7cf
[es/patchKibanaIndex] fix tests
spalger Jul 17, 2017
6317afd
[server/mappings] update docs
spalger Jul 17, 2017
12ff778
[es/healthCheck] use server.getKibanaIndexMappingsDsl()
spalger Jul 17, 2017
d6b20f0
[server/mappings] use *MappingsDsl naming for comprehension
spalger Jul 17, 2017
098ef57
[ftr/kbnServer] read kibana index mapping from es
spalger Jul 18, 2017
6c1adb4
Merge branch 'master' of github.com:elastic/kibana into single-type
spalger Jul 18, 2017
89bae9a
[ftr/mocha] add .skip variants to suite wrappers
spalger Jul 18, 2017
179f915
[es/patchKibanaIndex] update description
spalger Jul 18, 2017
fdec6fa
[ui/indexPatterns] remove stray async function in ui
spalger Jul 18, 2017
9f64888
[ftr/common] add kibanaIndex service
spalger Jul 18, 2017
12640d5
[savedObjects] support for sorting on multi-field
spalger Jul 18, 2017
cdd5a11
[savedObjects/client/searchDsl] improve searchDsl tests
spalger Jul 18, 2017
542e6e0
Excludes fields which do not exist
Jul 19, 2017
8fd583b
Merge branch 'master' of github.com:elastic/kibana into single-type
spalger Jul 19, 2017
e9ed890
[savedObjects/find] restore support for fields like "title^3"
spalger Jul 19, 2017
bf7772e
Adds test for field boosting and fixes lint error
Jul 19, 2017
fd6e4f7
Merge remote-tracking branch 'upstream/master' into single-type
Jul 19, 2017
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
3 changes: 1 addition & 2 deletions src/core_plugins/elasticsearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ export default function (kibana) {
}
);
// Set up the health check service and start it.
const mappings = kibana.uiExports.mappings.getCombined();
const { start, waitUntilReady } = healthCheck(this, server, { mappings });
const { start, waitUntilReady } = healthCheck(this, server);
server.expose('waitUntilReady', waitUntilReady);
start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('plugins/elasticsearch', function () {
config = function () { return { get: get }; };

_.set(server, 'config', config);
_.set(server, 'getKibanaIndexMappingsDsl', sinon.stub().returns(mappings));

callWithInternalUser = sinon.stub();
cluster = { callWithInternalUser: callWithInternalUser };
Expand All @@ -37,14 +38,14 @@ describe('plugins/elasticsearch', function () {
});

it('should check cluster.health upon successful index creation', function () {
const fn = createKibanaIndex(server, mappings);
const fn = createKibanaIndex(server);
return fn.then(function () {
sinon.assert.calledOnce(callWithInternalUser.withArgs('cluster.health', sinon.match.any));
});
});

it('should be created with mappings for config.buildNum', function () {
const fn = createKibanaIndex(server, mappings);
const fn = createKibanaIndex(server);
return fn.then(function () {
const params = callWithInternalUser.args[0][1];
expect(params)
Expand All @@ -63,7 +64,7 @@ describe('plugins/elasticsearch', function () {
});

it('should be created with 1 shard and default replica', function () {
const fn = createKibanaIndex(server, mappings);
const fn = createKibanaIndex(server);
return fn.then(function () {
const params = callWithInternalUser.args[0][1];
expect(params)
Expand All @@ -78,7 +79,7 @@ describe('plugins/elasticsearch', function () {
});

it('should be created with index name set in the config', function () {
const fn = createKibanaIndex(server, mappings);
const fn = createKibanaIndex(server);
return fn.then(function () {
const params = callWithInternalUser.args[0][1];
expect(params)
Expand Down
247 changes: 0 additions & 247 deletions src/core_plugins/elasticsearch/lib/__tests__/ensure_types_exist.js

This file was deleted.

24 changes: 12 additions & 12 deletions src/core_plugins/elasticsearch/lib/__tests__/health_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import mappings from './fixtures/mappings';
import healthCheck from '../health_check';
import kibanaVersion from '../kibana_version';
import { esTestServerUrlParts } from '../../../../../test/es_test_server_url_parts';
import * as ensureTypesExistNS from '../ensure_types_exist';
import * as patchKibanaIndexNS from '../patch_kibana_index';
import * as migrateConfigNS from '../migrate_config';

const esPort = esTestServerUrlParts.port;
const esUrl = url.format(esTestServerUrlParts);
Expand All @@ -21,13 +22,15 @@ describe('plugins/elasticsearch', () => {
let health;
let plugin;
let cluster;
const sandbox = sinon.sandbox.create();

beforeEach(() => {
const COMPATIBLE_VERSION_NUMBER = '5.0.0';

// Stub the Kibana version instead of drawing from package.json.
sinon.stub(kibanaVersion, 'get').returns(COMPATIBLE_VERSION_NUMBER);
sinon.stub(ensureTypesExistNS, 'ensureTypesExist');
sandbox.stub(kibanaVersion, 'get').returns(COMPATIBLE_VERSION_NUMBER);
sandbox.stub(patchKibanaIndexNS, 'patchKibanaIndex');
sandbox.stub(migrateConfigNS, 'migrateConfig');

// setup the plugin stub
plugin = {
Expand Down Expand Up @@ -73,19 +76,15 @@ describe('plugins/elasticsearch', () => {
getCluster: sinon.stub().returns(cluster)
}
},
savedObjectsClientFactory: () => ({
find: sinon.stub().returns(Promise.resolve({ saved_objects: [] })),
create: sinon.stub().returns(Promise.resolve({ id: 'foo' })),
})
getKibanaIndexMappingsDsl() {
return mappings;
}
};

health = healthCheck(plugin, server, { mappings });
health = healthCheck(plugin, server);
});

afterEach(() => {
kibanaVersion.get.restore();
ensureTypesExistNS.ensureTypesExist.restore();
});
afterEach(() => sandbox.restore());

it('should set the cluster green if everything is ready', function () {
cluster.callWithInternalUser.withArgs('ping').returns(Promise.resolve());
Expand All @@ -101,6 +100,7 @@ describe('plugins/elasticsearch', () => {
sinon.assert.calledOnce(cluster.callWithInternalUser.withArgs('ping'));
sinon.assert.calledTwice(cluster.callWithInternalUser.withArgs('nodes.info', sinon.match.any));
sinon.assert.calledOnce(cluster.callWithInternalUser.withArgs('cluster.health', sinon.match.any));
sinon.assert.notCalled(plugin.status.red);
sinon.assert.calledOnce(plugin.status.green);

expect(plugin.status.green.args[0][0]).to.be('Kibana index ready');
Expand Down
Loading