From 5400954ce63e4df4d15f769abc127d8956c599fa Mon Sep 17 00:00:00 2001 From: jzonthemtn Date: Tue, 10 Dec 2024 10:19:28 -0500 Subject: [PATCH] Fixing field name from query_id to user_query. --- .../scripts/get-click-through-rates.sh | 3 +++ .../eval/judgments/clickmodel/coec/CoecClickModel.java | 1 - .../eval/judgments/opensearch/OpenSearchHelper.java | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100755 opensearch-search-quality-evaluation-plugin/scripts/get-click-through-rates.sh diff --git a/opensearch-search-quality-evaluation-plugin/scripts/get-click-through-rates.sh b/opensearch-search-quality-evaluation-plugin/scripts/get-click-through-rates.sh new file mode 100755 index 0000000..16377a2 --- /dev/null +++ b/opensearch-search-quality-evaluation-plugin/scripts/get-click-through-rates.sh @@ -0,0 +1,3 @@ +#!/bin/bash -e + +curl -s "http://localhost:9200/click_through_rates/_search" | jq 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 ce9448f..381d2ee 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 @@ -46,7 +46,6 @@ import java.util.LinkedList; import java.util.Map; import java.util.Set; -import java.util.UUID; public class CoecClickModel extends ClickModel { 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 4b8cf4c..8832c72 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 @@ -267,12 +267,12 @@ public void indexClickthroughRates(final Map> clic final BulkRequest request = new BulkRequest(); - for(final String queryId : clickthroughRates.keySet()) { + for(final String userQuery : clickthroughRates.keySet()) { - for(final ClickthroughRate clickthroughRate : clickthroughRates.get(queryId)) { + for(final ClickthroughRate clickthroughRate : clickthroughRates.get(userQuery)) { final Map jsonMap = new HashMap<>(); - jsonMap.put("query_id", queryId); + jsonMap.put("user_query", userQuery); jsonMap.put("clicks", clickthroughRate.getClicks()); jsonMap.put("events", clickthroughRate.getEvents()); jsonMap.put("ctr", clickthroughRate.getClickthroughRate());