epotyom commented on code in PR #12862:
URL: https://github.com/apache/lucene/pull/12862#discussion_r1420764008
##########
lucene/facet/src/java/org/apache/lucene/facet/MultiFacets.java:
##########
@@ -77,6 +80,39 @@ public Number getSpecificValue(String dim, String... path)
throws IOException {
return facets.getSpecificValue(dim, path);
}
+ @Override
+ public Number[] getBulkSpecificValues(FacetLabel[] facetLabels) throws
IOException {
+ if (facetLabels.length == 0) {
+ return new Number[0];
+ }
+ // Split facetLabels into chunks by the Facets they belog to
+ Map<Facets, IntArrayList> labelsPerFacet = new HashMap<>();
+ for (int i = 0; i < facetLabels.length; i++) {
+ String dim = facetLabels[i].components[0];
+ Facets facets = dimToFacets.get(dim);
Review Comment:
The idea was to rely on defaults which make each object unique. But I just
found that there is `IdentityHashMap` class that always uses object ID even if
equals/hashCode are overriden, which I think is safer to use in this case.
Thanks for heads up!
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]