nit0906 commented on code in PR #671:
URL: https://github.com/apache/jackrabbit-oak/pull/671#discussion_r950291136


##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/ElasticResponseHandler.java:
##########
@@ -41,14 +43,22 @@ public class ElasticResponseHandler {
 
     private final PlanResult planResult;
     private final Filter filter;
+    private final Set<String> seenPaths = Sets.newHashSet();
 
     ElasticResponseHandler(@NotNull FulltextIndexPlanner.PlanResult 
planResult, @NotNull Filter filter) {
         this.planResult = planResult;
         this.filter = filter;
     }
 
     public String getPath(Hit<? extends JsonNode> hit) {
-        return transformPath(hit.source().get(FieldNames.PATH).asText());
+        String originalPath = hit.source().get(FieldNames.PATH).asText();
+
+        // Check here for path transformation to avoid maintaining seenPaths 
set in case of non transformed queries
+        if (planResult.isPathTransformed()) {

Review Comment:
   Done.



##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/ElasticResponseHandler.java:
##########
@@ -59,6 +69,13 @@ private String transformPath(String path) {
             return null;
         }
 
+        // avoid duplicate entries
+        // (This reduces number of entries passed on to QueryEngine for post 
processing in case of transformed path field queries)
+        if (seenPaths.contains(transformedPath)) {

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to