mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Maps] remove Kibana 8.1 deprecated API usage (#128912)
* [Maps] remove remaining 8.1.0 deprecations * fetch * review feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
e7eea48a6c
commit
d0e4eefb47
5 changed files with 31 additions and 23 deletions
|
@ -201,11 +201,13 @@ export class ESPewPewSource extends AbstractESAggSource {
|
|||
try {
|
||||
const abortController = new AbortController();
|
||||
registerCancelCallback(() => abortController.abort());
|
||||
const esResp = await searchSource.fetch({
|
||||
abortSignal: abortController.signal,
|
||||
legacyHitsTotal: false,
|
||||
executionContext: makePublicExecutionContext('es_pew_pew_source:bounds'),
|
||||
});
|
||||
const { rawResponse: esResp } = await searchSource
|
||||
.fetch$({
|
||||
abortSignal: abortController.signal,
|
||||
legacyHitsTotal: false,
|
||||
executionContext: makePublicExecutionContext('es_pew_pew_source:bounds'),
|
||||
})
|
||||
.toPromise();
|
||||
if (esResp.aggregations.destFitToBounds.bounds) {
|
||||
corners.push([
|
||||
esResp.aggregations.destFitToBounds.bounds.top_left.lon,
|
||||
|
|
|
@ -597,10 +597,12 @@ export class ESSearchSource extends AbstractESSource implements IMvtVectorSource
|
|||
searchSource.setField('query', query);
|
||||
searchSource.setField('fieldsFromSource', this._getTooltipPropertyNames());
|
||||
|
||||
const resp = await searchSource.fetch({
|
||||
legacyHitsTotal: false,
|
||||
executionContext: makePublicExecutionContext('es_search_source:load_tooltip_properties'),
|
||||
});
|
||||
const { rawResponse: resp } = await searchSource
|
||||
.fetch$({
|
||||
legacyHitsTotal: false,
|
||||
executionContext: makePublicExecutionContext('es_search_source:load_tooltip_properties'),
|
||||
})
|
||||
.toPromise();
|
||||
|
||||
const hit = _.get(resp, 'hits.hits[0]');
|
||||
if (!hit) {
|
||||
|
@ -899,12 +901,14 @@ export class ESSearchSource extends AbstractESSource implements IMvtVectorSource
|
|||
const maxResultWindow = await this.getMaxResultWindow();
|
||||
const searchSource = await this.makeSearchSource(searchFilters, 0);
|
||||
searchSource.setField('trackTotalHits', maxResultWindow + 1);
|
||||
const resp = await searchSource.fetch({
|
||||
abortSignal: abortController.signal,
|
||||
sessionId: searchFilters.searchSessionId,
|
||||
legacyHitsTotal: false,
|
||||
executionContext: makePublicExecutionContext('es_search_source:all_doc_counts'),
|
||||
});
|
||||
const { rawResponse: resp } = await searchSource
|
||||
.fetch$({
|
||||
abortSignal: abortController.signal,
|
||||
sessionId: searchFilters.searchSessionId,
|
||||
legacyHitsTotal: false,
|
||||
executionContext: makePublicExecutionContext('es_search_source:all_doc_counts'),
|
||||
})
|
||||
.toPromise();
|
||||
return !isTotalHitsGreaterThan(resp.hits.total as unknown as TotalHits, maxResultWindow);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -279,11 +279,13 @@ export class AbstractESSource extends AbstractVectorSource implements IESSource
|
|||
try {
|
||||
const abortController = new AbortController();
|
||||
registerCancelCallback(() => abortController.abort());
|
||||
const esResp = await searchSource.fetch({
|
||||
abortSignal: abortController.signal,
|
||||
legacyHitsTotal: false,
|
||||
executionContext: makePublicExecutionContext('es_source:bounds'),
|
||||
});
|
||||
const { rawResponse: esResp } = await searchSource
|
||||
.fetch$({
|
||||
abortSignal: abortController.signal,
|
||||
legacyHitsTotal: false,
|
||||
executionContext: makePublicExecutionContext('es_source:bounds'),
|
||||
})
|
||||
.toPromise();
|
||||
|
||||
if (!esResp.aggregations) {
|
||||
return null;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { canSkipSourceUpdate, updateDueToExtent } from './can_skip_fetch';
|
||||
import { DataRequest } from './data_request';
|
||||
import { Filter } from 'src/plugins/data/common';
|
||||
import { Filter } from '@kbn/es-query';
|
||||
import { ISource } from '../sources/source';
|
||||
|
||||
describe('updateDueToExtent', () => {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { LAYER_TYPE, SOURCE_TYPES, SCALING_TYPES } from '../common/constants';
|
||||
import { esFilters } from '../../../../src/plugins/data/public';
|
||||
import { FilterStateStore } from '@kbn/es-query';
|
||||
import { MapsAppLocatorDefinition } from './locators';
|
||||
import { SerializableRecord } from '@kbn/utility-types';
|
||||
import { LayerDescriptor } from '../common/descriptor_types';
|
||||
|
@ -100,7 +100,7 @@ describe('visualize url generator', () => {
|
|||
},
|
||||
query: { query: 'q1' },
|
||||
$state: {
|
||||
store: esFilters.FilterStateStore.GLOBAL_STATE,
|
||||
store: FilterStateStore.GLOBAL_STATE,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue