From 6a5c159a3620abb3e1e4202c077cacbc41134abe Mon Sep 17 00:00:00 2001 From: Tim Urista Date: Fri, 21 Aug 2020 15:09:25 -0700 Subject: [PATCH] add update to the es query for stats repo --- .../api/statistics/repository/StatisticsRepositoryImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/pacman-api-statistics/src/main/java/com/tmobile/pacman/api/statistics/repository/StatisticsRepositoryImpl.java b/api/pacman-api-statistics/src/main/java/com/tmobile/pacman/api/statistics/repository/StatisticsRepositoryImpl.java index d42d2951f..a9ff75cab 100644 --- a/api/pacman-api-statistics/src/main/java/com/tmobile/pacman/api/statistics/repository/StatisticsRepositoryImpl.java +++ b/api/pacman-api-statistics/src/main/java/com/tmobile/pacman/api/statistics/repository/StatisticsRepositoryImpl.java @@ -156,7 +156,7 @@ public JsonArray getNumberOfAccounts() throws DataException { StringBuilder urlToQueryBuffer = new StringBuilder(esUrl).append("/").append(AWS).append("/") .append(SEARCH); StringBuilder requestBody = new StringBuilder( - "{\"query\":{\"bool\":{}},\"aggs\":{\"accounts\":{\"terms\":{\"field\":\"accountname.keyword\",\"size\":10000}}}}"); + "{\"query\":{\"bool\":{}},\"aggs\":{\"accounts\":{\"terms\":{\"field\":\"accountid.keyword\",\"size\":10000}}}}"); String responseDetails = PacHttpUtils.doHttpPost(urlToQueryBuffer.toString(), requestBody.toString()); JsonObject paramObj = parser.parse(responseDetails).getAsJsonObject(); JsonObject aggsJson = (JsonObject) parser.parse(paramObj.get(AGGS).toString()); @@ -266,4 +266,4 @@ public List> getAutofixActionCountByRule() throws DataExcept } } -} \ No newline at end of file +}