diff --git a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/SearchQualityEvaluationRestHandler.java b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/SearchQualityEvaluationRestHandler.java index e2b09c3..b7dcab6 100644 --- a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/SearchQualityEvaluationRestHandler.java +++ b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/SearchQualityEvaluationRestHandler.java @@ -412,7 +412,7 @@ public void onResponse(final IndicesExistsResponse indicesExistsResponse) { client.admin().indices().create(createIndexRequest, new ActionListener<>() { @Override public void onResponse(CreateIndexResponse createIndexResponse) { - LOGGER.info("Judgments index created: {}", JUDGMENTS_INDEX_NAME); + LOGGER.debug("Judgments index created: {}", JUDGMENTS_INDEX_NAME); } @Override diff --git a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/clickmodel/coec/CoecClickModel.java b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/clickmodel/coec/CoecClickModel.java index 54c4630..819205a 100644 --- a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/clickmodel/coec/CoecClickModel.java +++ b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/clickmodel/coec/CoecClickModel.java @@ -382,9 +382,7 @@ private void showClickthroughRates(final Map> clic LOGGER.info("user_query: {}", userQuery); for(final ClickthroughRate clickthroughRate : clickthroughRates.get(userQuery)) { - LOGGER.info("\t - {}", clickthroughRate.toString()); - } } @@ -394,9 +392,7 @@ private void showClickthroughRates(final Map> clic private void showRankAggregatedClickThrough(final Map rankAggregatedClickThrough) { for(final int position : rankAggregatedClickThrough.keySet()) { - LOGGER.info("Position: {}, # ctr: {}", position, MathUtils.round(rankAggregatedClickThrough.get(position), parameters.getRoundingDigits())); - } } diff --git a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/opensearch/OpenSearchHelper.java b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/opensearch/OpenSearchHelper.java index 354724d..ebff575 100644 --- a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/opensearch/OpenSearchHelper.java +++ b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/judgments/opensearch/OpenSearchHelper.java @@ -118,8 +118,6 @@ public UbiQuery getQueryFromQueryId(final String queryId) throws Exception { if(response.getHits().getHits() != null & response.getHits().getHits().length > 0) { final SearchHit hit = response.getHits().getHits()[0]; - - //LOGGER.info("Retrieved query from query ID {}", queryId); return AccessController.doPrivileged((PrivilegedAction) () -> gson.fromJson(hit.getSourceAsString(), UbiQuery.class)); } else { @@ -165,8 +163,6 @@ public long getCountOfQueriesForUserQueryHavingResultInRankR(final String userQu // For each query ID, get the events with action_name = "impression" having a match on objectId and rank (position). for(final String queryId : queryIds) { - //LOGGER.info("userQuery = {}; queryId = {}; objectId = {}; rank = {}", userQuery, queryId, objectId, rank); - final String query = "{\n" + " \"bool\": {\n" + " \"must\": [\n" + @@ -194,9 +190,6 @@ public long getCountOfQueriesForUserQueryHavingResultInRankR(final String userQu " }\n" + " }"; - //LOGGER.info(query); - //LOGGER.info("----------------------------------------------------"); - final WrapperQueryBuilder qb = QueryBuilders.wrapperQuery(query); final SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); @@ -209,18 +202,6 @@ public long getCountOfQueriesForUserQueryHavingResultInRankR(final String userQu final SearchRequest searchRequest = new SearchRequest(indexes, searchSourceBuilder); final SearchResponse response = client.search(searchRequest).get(); -// if(queryId.equals("a2151d8c-44b6-4af6-9993-39cd7798671b")) { -// if(objectId.equals("B07R1J8TYC")) { -// if(rank == 4) { -// LOGGER.info("This is the one!"); -// LOGGER.info("Hits = {}", response.getHits().getTotalHits().value); -// LOGGER.info(response.toString()); -// } -// } -// } - - //LOGGER.info("Query ID: {} --- Count of {} having {} at rank {} = {}", queryId, userQuery, objectId, rank, response.getHits().getTotalHits().value); - // Won't be null as long as trackTotalHits is true. if(response.getHits().getTotalHits() != null) { countOfTimesShownAtRank += response.getHits().getTotalHits().value; @@ -228,42 +209,14 @@ public long getCountOfQueriesForUserQueryHavingResultInRankR(final String userQu } - //LOGGER.info("Count of {} having {} at rank {} = {}", userQuery, objectId, rank, countOfTimesShownAtRank); + LOGGER.debug("Count of {} having {} at rank {} = {}", userQuery, objectId, rank, countOfTimesShownAtRank); if(countOfTimesShownAtRank > 0) { - //LOGGER.info("Count of {} having {} at rank {} = {}", userQuery, objectId, rank, countOfTimesShownAtRank); + LOGGER.debug("Count of {} having {} at rank {} = {}", userQuery, objectId, rank, countOfTimesShownAtRank); } return countOfTimesShownAtRank; - /* - - // This commented block was used to get the value using the ubi_queries index. - // We can now just use the ubi_events index. - - final String query = "{\"match\": {\"user_query\": \"" + userQuery + "\" }}"; - final WrapperQueryBuilder qb = QueryBuilders.wrapperQuery(query); - - final SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); - searchSourceBuilder.query(qb); - - final String[] indexes = {INDEX_UBI_QUERIES}; - - final SearchRequest searchRequest = new SearchRequest(indexes, searchSourceBuilder); - final SearchResponse response = client.search(searchRequest).get(); - - for(final SearchHit searchHit : response.getHits().getHits()) { - - final List queryResponseHidsIds = (List) searchHit.getSourceAsMap().get("query_response_hit_ids"); - - if(queryResponseHidsIds.get(rank).equals(objectId)) { - countOfTimesShownAtRank++; - } - - } - - */ - } /** diff --git a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/metrics/DcgSearchMetric.java b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/metrics/DcgSearchMetric.java index 55fa60a..d42d585 100644 --- a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/metrics/DcgSearchMetric.java +++ b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/metrics/DcgSearchMetric.java @@ -46,7 +46,7 @@ protected double calculateDcg(final List relevanceScores) { final double numerator = Math.pow(2, relevanceScore) - 1.0; final double denominator = Math.log(i) / Math.log(i + 2); - LOGGER.info("numerator = {}, denominator = {}", numerator, denominator); + LOGGER.debug("numerator = {}, denominator = {}", numerator, denominator); dcg += (numerator / denominator); } diff --git a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/runners/AbstractQuerySetRunner.java b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/runners/AbstractQuerySetRunner.java index 30b2dee..2d87bc5 100644 --- a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/runners/AbstractQuerySetRunner.java +++ b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/runners/AbstractQuerySetRunner.java @@ -139,11 +139,6 @@ public Double getJudgmentValue(final String judgmentsId, final String query, fin // TODO: Why does this not exist in some cases? if(j.containsKey("judgment")) { judgment = (Double) j.get("judgment"); - - if(judgment > 0) { - LOGGER.info("Found a nonzero judgment! = {}, {}", judgment, query); - } - } } else { diff --git a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/runners/OpenSearchQuerySetRunner.java b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/runners/OpenSearchQuerySetRunner.java index 0e684fa..30cc8ca 100644 --- a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/runners/OpenSearchQuerySetRunner.java +++ b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/runners/OpenSearchQuerySetRunner.java @@ -124,7 +124,7 @@ public void onResponse(final SearchResponse searchResponse) { queryResults.add(new QueryResult(userQuery, orderedDocumentIds, k, searchMetrics)); } catch (Exception ex) { - LOGGER.error("Unable to get relevance scores.", ex); + LOGGER.error("Unable to get relevance scores for judgments {} and user query {}.", judgmentsId, userQuery, ex); } } diff --git a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/samplers/AbstractQuerySampler.java b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/samplers/AbstractQuerySampler.java index 973096e..b954d0c 100644 --- a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/samplers/AbstractQuerySampler.java +++ b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/samplers/AbstractQuerySampler.java @@ -86,8 +86,8 @@ public void onResponse(IndexResponse indexResponse) { } @Override - public void onFailure(Exception e) { - LOGGER.error("Unable to index query set {}", querySetId, e); + public void onFailure(Exception ex) { + LOGGER.error("Unable to index query set {}", querySetId, ex); } }); diff --git a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/samplers/AllQueriesQuerySampler.java b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/samplers/AllQueriesQuerySampler.java index 4f105c0..7d76af6 100644 --- a/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/samplers/AllQueriesQuerySampler.java +++ b/opensearch-search-quality-evaluation-plugin/src/main/java/org/opensearch/eval/samplers/AllQueriesQuerySampler.java @@ -58,16 +58,12 @@ public String sample() throws Exception { final SearchResponse searchResponse = client.search(searchRequest).get(); - // LOGGER.info("Found {} user queries from the ubi_queries index.", searchResponse.getHits().getTotalHits().toString()); - final Map queries = new HashMap<>(); for(final SearchHit hit : searchResponse.getHits().getHits()) { final Map fields = hit.getSourceAsMap(); queries.merge(fields.get("user_query").toString(), 1L, Long::sum); } - // LOGGER.info("Found {} user queries from the ubi_queries index.", queries.size()); - return indexQuerySet(client, parameters.getName(), parameters.getDescription(), parameters.getSampling(), queries); }