diff --git a/data/esci/index.sh b/data/esci/index.sh index 95f915f..6b2b053 100755 --- a/data/esci/index.sh +++ b/data/esci/index.sh @@ -7,4 +7,4 @@ echo "Initializing UBI..." curl -s -X POST "http://localhost:9200/_plugins/ubi/initialize" echo "Indexing queries and events..." -curl -X POST 'http://localhost:9200/index-name/_bulk?pretty' --data-binary @ubi_queries_events.ndjson -H "Content-Type: application/x-ndjson" \ No newline at end of file +curl -X POST 'http://localhost:9200/_bulk?pretty' --data-binary @ubi_queries_events.ndjson -H "Content-Type: application/x-ndjson" \ No newline at end of file diff --git a/scripts/opensearch-scripts/get-rank-aggregated-ctr.sh b/scripts/opensearch-scripts/get-rank-aggregated-ctr.sh new file mode 100755 index 0000000..f47c1f0 --- /dev/null +++ b/scripts/opensearch-scripts/get-rank-aggregated-ctr.sh @@ -0,0 +1,11 @@ +#!/bin/bash -e + +curl -s "http://localhost:9200/rank_aggregated_ctr/_search" -H "Content-type: application/json" -d'{ + "query": { + "range": { + "ctr": { + "gt": 0 + } + } + } +}' \ No newline at end of file diff --git a/src/main/java/org/opensearch/eval/engine/OpenSearchEngine.java b/src/main/java/org/opensearch/eval/engine/OpenSearchEngine.java index 621d5ef..404594c 100644 --- a/src/main/java/org/opensearch/eval/engine/OpenSearchEngine.java +++ b/src/main/java/org/opensearch/eval/engine/OpenSearchEngine.java @@ -645,8 +645,8 @@ public Map getRankAggregatedClickThrough(final int maxRank) thr final List positionBuckets = positionTerms.lterms().buckets().array(); for(final LongTermsBucket positionBucket : positionBuckets) { - LOGGER.debug("Inserting client event from position {} with click count {}", positionBucket.key(), (double) positionBucket.docCount()); - impressionCounts.put(Integer.valueOf(positionBucket.key()), (double) positionBucket.docCount()); + LOGGER.debug("Inserting click event from position {} with click count {}", positionBucket.key(), (double) positionBucket.docCount()); + clickCounts.put(Integer.valueOf(positionBucket.key()), (double) positionBucket.docCount()); } } @@ -681,6 +681,7 @@ public Map getRankAggregatedClickThrough(final int maxRank) thr } + // Index the calculated values. indexRankAggregatedClickthrough(rankAggregatedClickThrough); return rankAggregatedClickThrough;