Skip to content

Commit

Permalink
Change default anomaly grade to nonzero (opensearch-project#148) (ope…
Browse files Browse the repository at this point in the history
…nsearch-project#149)

(cherry picked from commit a87b957)

Signed-off-by: Tyler Ohlsen <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: yuye-aws <[email protected]>
  • Loading branch information
2 people authored and yuye-aws committed Apr 26, 2024
1 parent e19fd74 commit f1945a9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public <T> void run(Map<String, String> parameters, ActionListener<T> listener)
final Boolean realTime = parameters.containsKey("realTime") ? Boolean.parseBoolean(parameters.get("realTime")) : null;
final Double anomalyGradeThreshold = parameters.containsKey("anomalyGradeThreshold")
? Double.parseDouble(parameters.get("anomalyGradeThreshold"))
: null;
: 0;
final Long dataStartTime = parameters.containsKey("dataStartTime") && StringUtils.isNumeric(parameters.get("dataStartTime"))
? Long.parseLong(parameters.get("dataStartTime"))
: null;
Expand Down Expand Up @@ -115,7 +115,7 @@ public <T> void run(Map<String, String> parameters, ActionListener<T> listener)
mustList.add(boolQuery);
}
if (anomalyGradeThreshold != null) {
mustList.add(new RangeQueryBuilder("anomaly_grade").gte(anomalyGradeThreshold));
mustList.add(new RangeQueryBuilder("anomaly_grade").gt(anomalyGradeThreshold));
}
if (dataStartTime != null || dataEndTime != null) {
RangeQueryBuilder rangeQuery = new RangeQueryBuilder("anomaly_grade");
Expand Down

0 comments on commit f1945a9

Please sign in to comment.