fabriziofortino commented on code in PR #2145:
URL: https://github.com/apache/jackrabbit-oak/pull/2145#discussion_r1991828040


##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/async/facets/ElasticSecureFacetAsyncProvider.java:
##########
@@ -58,11 +60,14 @@ class ElasticSecureFacetAsyncProvider implements 
ElasticFacetProvider, ElasticRe
         this.elasticResponseHandler = elasticResponseHandler;
         this.isAccessible = isAccessible;
         this.facetFields = 
elasticRequestHandler.facetFields().collect(Collectors.toSet());
+        this.elasticFieldNames = elasticRequestHandler.facetFields().
+                map(p -> ElasticIndexUtils.fieldName(p)).
+                collect(Collectors.toSet());

Review Comment:
   no need to keep both facetFields and elasticFieldNames. We only need Set 
with the latter. By doing this, we can also remove the call `String 
elasticField = ElasticIndexUtils.fieldName(field);` at line 83.



##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/async/facets/ElasticStatisticalFacetAsyncProvider.java:
##########
@@ -74,11 +76,15 @@ public class ElasticStatisticalFacetAsyncProvider 
implements ElasticFacetProvide
 
         this.elasticResponseHandler = elasticResponseHandler;
         this.isAccessible = isAccessible;
-        this.facetFields = 
elasticRequestHandler.facetFields().collect(Collectors.toSet());
+        this.facetFields = elasticRequestHandler.facetFields().
+                collect(Collectors.toSet());
+        Set<String> elasticFieldNames = facetFields.stream().

Review Comment:
   Same comment made in `ElasticSecureFacetAsyncProvider`. We don't need to 
keep both Sets. Only the one with the fields converted using `ElasticIndexUtils 
` is required.



-- 
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