[Maps] upgrade server to use new elasticsearch-js client (#95314)
* [Maps] upgrade server to use new elasticsearch-js client * update functional test expect
This commit is contained in:
parent
6d6ef0092a
commit
373a108cfe
|
@ -575,13 +575,10 @@ export async function initRoutes(
|
|||
}
|
||||
|
||||
try {
|
||||
const resp = await context.core.elasticsearch.legacy.client.callAsCurrentUser(
|
||||
'indices.getSettings',
|
||||
{
|
||||
index: query.indexPatternTitle,
|
||||
}
|
||||
);
|
||||
const indexPatternSettings = getIndexPatternSettings(resp);
|
||||
const resp = await context.core.elasticsearch.client.asCurrentUser.indices.getSettings({
|
||||
index: query.indexPatternTitle,
|
||||
});
|
||||
const indexPatternSettings = getIndexPatternSettings(resp.body);
|
||||
return response.ok({
|
||||
body: indexPatternSettings,
|
||||
});
|
||||
|
|
|
@ -11,6 +11,7 @@ export default function ({ loadTestFile, getService }) {
|
|||
describe('Maps endpoints', () => {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.load('maps/data');
|
||||
});
|
||||
|
||||
describe('', () => {
|
||||
|
|
|
@ -11,7 +11,7 @@ export default function ({ getService }) {
|
|||
const supertest = getService('supertest');
|
||||
|
||||
describe('index settings', () => {
|
||||
it('should return index settings', async () => {
|
||||
it('should return default index settings when max_result_window and max_inner_result_window are not set', async () => {
|
||||
const resp = await supertest
|
||||
.get(`/api/maps/indexSettings?indexPatternTitle=logstash*`)
|
||||
.set('kbn-xsrf', 'kibana')
|
||||
|
@ -20,5 +20,15 @@ export default function ({ getService }) {
|
|||
expect(resp.body.maxResultWindow).to.be(10000);
|
||||
expect(resp.body.maxInnerResultWindow).to.be(100);
|
||||
});
|
||||
|
||||
it('should return index settings', async () => {
|
||||
const resp = await supertest
|
||||
.get(`/api/maps/indexSettings?indexPatternTitle=geo_shape*`)
|
||||
.set('kbn-xsrf', 'kibana')
|
||||
.expect(200);
|
||||
|
||||
expect(resp.body.maxResultWindow).to.be(10001);
|
||||
expect(resp.body.maxInnerResultWindow).to.be(101);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ export default function ({ getPageObjects, getService }) {
|
|||
|
||||
//Source should be correct
|
||||
expect(mapboxStyle.sources[VECTOR_SOURCE_ID].tiles[0]).to.equal(
|
||||
'/api/maps/mvt/getTile?x={x}&y={y}&z={z}&geometryFieldName=geometry&index=geo_shapes*&requestBody=(_source:!(geometry),docvalue_fields:!(prop1),query:(bool:(filter:!((match_all:())),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(),size:10000,stored_fields:!(geometry,prop1))&geoFieldType=geo_shape'
|
||||
'/api/maps/mvt/getTile?x={x}&y={y}&z={z}&geometryFieldName=geometry&index=geo_shapes*&requestBody=(_source:!(geometry),docvalue_fields:!(prop1),query:(bool:(filter:!((match_all:())),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(),size:10001,stored_fields:!(geometry,prop1))&geoFieldType=geo_shape'
|
||||
);
|
||||
|
||||
//Should correctly load meta for style-rule (sigma is set to 1, opacity to 1)
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
"settings": {
|
||||
"index": {
|
||||
"number_of_replicas": "0",
|
||||
"number_of_shards": "1"
|
||||
"number_of_shards": "1",
|
||||
"max_result_window": "10001",
|
||||
"max_inner_result_window": "101"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue