diff --git a/opensearch-search-quality-evaluation-plugin/scripts/run-query-set.sh b/opensearch-search-quality-evaluation-plugin/scripts/run-query-set.sh index 57fa689..8518420 100755 --- a/opensearch-search-quality-evaluation-plugin/scripts/run-query-set.sh +++ b/opensearch-search-quality-evaluation-plugin/scripts/run-query-set.sh @@ -1,7 +1,7 @@ #!/bin/bash -e -QUERY_SET_ID="6b6540d4-4a42-489b-8974-5104075fe2a5" -JUDGMENTS_ID="f39109eb-8992-4ff9-95a6-798507b84ffe" +QUERY_SET_ID="8a2b8455-a442-49c3-9d34-2985c3ba08d3" +JUDGMENTS_ID="3cf6270b-9ebe-4c5a-bd4b-5ba362bd5a5e" INDEX="ecommerce" ID_FIELD="asin" K="20" 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 264104f..1aaf4bd 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 @@ -89,14 +89,11 @@ public QuerySetRunResult run(final String querySetId, final String judgmentsId, LOGGER.info(searchSourceBuilder.toString()); - if(searchPipeline != null) { - searchSourceBuilder.pipeline(searchPipeline); - } - final SearchRequest searchRequest = new SearchRequest(index); searchRequest.source(searchSourceBuilder); if(searchPipeline != null) { + searchSourceBuilder.pipeline(searchPipeline); searchRequest.pipeline(searchPipeline); } @@ -118,8 +115,8 @@ public void onResponse(final SearchResponse searchResponse) { if("_id".equals(idField)) { documentId = hit.getId(); } else { - final Map sourceAsMap = hit.getSourceAsMap(); - documentId = sourceAsMap.get(idField).toString(); + // TODO: Need to check this field actually exists. + documentId = hit.getSourceAsMap().get(idField).toString(); } orderedDocumentIds.add(documentId);