Skip to content

Commit

Permalink
[ES body removal] @elastic/appex-qa (elastic#204878)
Browse files Browse the repository at this point in the history
## Summary

Attempt to remove the deprecated `body` in the ES client.
  • Loading branch information
afharo authored Dec 19, 2024
1 parent 8b3281d commit b189fe7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { Transform, Readable } from 'stream';
import { inspect } from 'util';

import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import * as estypes from '@elastic/elasticsearch/lib/api/types';
import type { Client } from '@elastic/elasticsearch';
import { ToolingLog } from '@kbn/tooling-log';

Expand Down
36 changes: 17 additions & 19 deletions packages/kbn-performance-testing-dataset-extractor/src/es_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { Client } from '@elastic/elasticsearch';
import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
import { SearchRequest, MsearchRequestItem } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { SearchRequest, MsearchRequestItem } from '@elastic/elasticsearch/lib/api/types';
import { ToolingLog } from '@kbn/tooling-log';

interface ClientOptions {
Expand Down Expand Up @@ -116,26 +116,24 @@ export class ESClient {
async getTransactions<T>(queryFilters: QueryDslQueryContainer[]) {
const searchRequest: SearchRequest = {
index: this.tracesIndex,
body: {
sort: [
{
'@timestamp': {
order: 'asc',
unmapped_type: 'boolean',
},
sort: [
{
'@timestamp': {
order: 'asc',
unmapped_type: 'boolean',
},
],
size: 10000,
query: {
bool: {
filter: [
{
bool: {
filter: queryFilters,
},
},
],
size: 10000,
query: {
bool: {
filter: [
{
bool: {
filter: queryFilters,
},
],
},
},
],
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
* 2.0.
*/

import type {
AggregationsAggregate,
SearchResponse,
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { AggregationsAggregate, SearchResponse } from '@elastic/elasticsearch/lib/api/types';
import { MetricThresholdParams } from '@kbn/infra-plugin/common/alerting/metrics';
import { ThresholdParams } from '@kbn/observability-plugin/common/custom_threshold_rule/types';
import { ApmRuleParamsType } from '@kbn/apm-plugin/common/rules/schema';
Expand Down

0 comments on commit b189fe7

Please sign in to comment.