Skip to content

Commit

Permalink
Persisting the query run results.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzonthemtn committed Jan 21, 2025
1 parent e154262 commit 5a2cb16
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
3 changes: 3 additions & 0 deletions scripts/opensearch-scripts/get-metrics.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash -e

curl -s "http://localhost:9200/sqe_metrics_sample_data/_search" | jq
10 changes: 0 additions & 10 deletions scripts/opensearch-scripts/get-models.sh

This file was deleted.

6 changes: 3 additions & 3 deletions scripts/run-query-set.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"query_set_id": "20b2c5d3-42bf-4aaf-843e-d806e9fcd3c1",
"judgments_id": "69a69c21-f0bb-443e-bf75-bca389704fd0",
"query_set_id": "6d2a8d56-a9e6-4f99-9a81-482974d11c32",
"judgments_id": "c2d46e06-0e37-4370-b547-296b554c646e",
"index": "ecommerce",
"search_pipeline": "filter_pipeline",
"search_pipeline": "",
"id_field": "asin",
"k": 10,
"threshold": 1.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public String calculateCoec(final Map<Integer, Double> rankAggregatedClickThroug

}

// Numerator is sum of clicks at all ranks up to the maxRank.
// Numerator is the sum of clicks at all ranks up to the maxRank.
final long totalNumberClicksForQueryResult = ctr.getClicks();

// Divide the numerator by the denominator (value).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ public QuerySetRunResult run(final RunQuerySetParameters querySetParameters) thr
final String querySetRunId = UUID.randomUUID().toString();
final QuerySetRunResult querySetRunResult = new QuerySetRunResult(querySetRunId, querySetParameters.getQuerySetId(), queryResults, querySetMetrics);

save(querySetRunResult);

LOGGER.info("Query set run complete: {}", querySetRunId);

return querySetRunResult;
Expand All @@ -130,6 +132,8 @@ public QuerySetRunResult run(final RunQuerySetParameters querySetParameters) thr
@Override
public void save(final QuerySetRunResult result) throws Exception {

LOGGER.info("Indexing query run results.");

// Now, index the metrics as expected by the dashboards.

// See https://github.com/o19s/opensearch-search-quality-evaluation/blob/main/opensearch-dashboard-prototyping/METRICS_SCHEMA.md
Expand Down

0 comments on commit 5a2cb16

Please sign in to comment.