Skip to content

Commit

Permalink
Minor clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzonthemtn committed Dec 11, 2024
1 parent 3a12dd7 commit a5d933c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -118,8 +115,8 @@ public void onResponse(final SearchResponse searchResponse) {
if("_id".equals(idField)) {
documentId = hit.getId();
} else {
final Map<String, Object> 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);
Expand Down

0 comments on commit a5d933c

Please sign in to comment.