Skip to content
Permalink
Browse files

Added a "_query" field to each object under "hit"."hits" and "queries…

…" to indicate which query of which hop that the object relates to.
  • Loading branch information...
davemoore- committed Jul 26, 2019
1 parent 1f3e452 commit ac567bb15ca6a23ba7abebdf590d448986210c26
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/main/java/io/zentity/resolution/Job.java
@@ -584,6 +584,7 @@ private void traverse() throws IOException, ValidationException {
// Prepare to collect attributes from the results of these queries as the inputs to subsequent queries.
Map<String, Attribute> nextInputAttributes = new TreeMap<>();
Boolean newHits = false;
int _query = 0;

// Construct a query for each index that maps to a resolver.
for (String indexName : this.input.model().indices().keySet()) {
@@ -976,7 +977,7 @@ else if (!resolversClause.isEmpty())
}
String filtersLogged = String.join(",", filtersLoggedList);
String searchLogged = "{\"request\":" + query + ",\"response\":" + responseDataCopyObj + "}";
String logged = "{\"_hop\":" + this.hop + ",\"_index\":\"" + indexName + "\",\"filters\":{" + filtersLogged + "},\"search\":" + searchLogged + "}";
String logged = "{\"_hop\":" + this.hop + ",\"_query\":" + _query + ",\"_index\":\"" + indexName + "\",\"filters\":{" + filtersLogged + "},\"search\":" + searchLogged + "}";
this.queries.add(logged);
}

@@ -1048,6 +1049,7 @@ else if (!resolversClause.isEmpty())
docObjNode.remove("_score");
docObjNode.remove("fields");
docObjNode.put("_hop", this.hop);
docObjNode.put("_query", _query);
if (this.includeAttributes) {
ObjectNode docAttributesObjNode = docObjNode.putObject("_attributes");
for (String attributeName : docAttributes.keySet()) {
@@ -1127,6 +1129,7 @@ else if (input.model().matchers().containsKey(matcherName))
this.hits.add(doc.toString());
}
}
_query++;
}

// Stop traversing if we've reached max depth.

0 comments on commit ac567bb

Please sign in to comment.
You can’t perform that action at this time.