Skip to content

Commit

Permalink
removes debug log, removes unnecessary ts expect error, fixes bug whe…
Browse files Browse the repository at this point in the history
…re aggs.terms.missing field could be a string or a number
  • Loading branch information
dhurley14 committed Aug 18, 2021
1 parent a8188db commit 5de23b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/rule_registry/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ interface BucketAggsSchemas {
exclude?: string | string[];
include?: string | string[];
execution_hint?: string;
missing?: number;
missing?: number | string;
min_doc_count?: number;
size?: number;
show_term_doc_count_error?: boolean;
Expand Down Expand Up @@ -170,7 +170,7 @@ export const BucketAggsSchemas: t.Type<BucketAggsSchemas> = t.recursion('BucketA
exclude: t.union([t.string, t.array(t.string)]),
include: t.union([t.string, t.array(t.string)]),
execution_hint: t.string,
missing: t.number,
missing: t.union([t.number, t.string]),
min_doc_count: t.number,
size: t.number,
show_term_doc_count_error: t.boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,7 @@ export class AlertsClient {
query,
aggs,
_source,
// eslint-disable-next-line @typescript-eslint/naming-convention
track_total_hits,
track_total_hits: trackTotalHits,
size,
index,
}: {
Expand All @@ -624,16 +623,13 @@ export class AlertsClient {
_source?: string[] | undefined;
size?: number | undefined;
}) {
this.logger.debug(
JSON.stringify({ query, aggs, _source, track_total_hits, size, index }, null, 2)
);
try {
// first search for the alert by id, then use the alert info to check if user has access to it
const alertsSearchResponse = await this.singleSearchAfterAndAudit({
query,
aggs,
_source,
track_total_hits,
track_total_hits: trackTotalHits,
size,
index,
operation: ReadOperations.Find,
Expand Down

0 comments on commit 5de23b5

Please sign in to comment.