You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "gsmiller (via GitHub)" <gi...@apache.org> on 2024/08/12 16:03:40 UTC
[PR] Backport #13568 [lucene]
gsmiller opened a new pull request, #13645:
URL: https://github.com/apache/lucene/pull/13645
(no comment)
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Backport #13568 [lucene]
Posted by "epotyom (via GitHub)" <gi...@apache.org>.
epotyom commented on code in PR #13645:
URL: https://github.com/apache/lucene/pull/13645#discussion_r1714080529
##########
lucene/facet/src/java/org/apache/lucene/facet/DrillSideways.java:
##########
@@ -240,46 +242,43 @@ public DrillSidewaysResult search(DrillDownQuery query, Collector hitCollector)
int numDims = drillDownDims.size();
FacetsCollectorManager drillDownCollectorManager = createDrillDownFacetsCollectorManager();
+ final CollectorOwner<FacetsCollector, FacetsCollector> drillDownCollectorOwner;
+ if (drillDownCollectorManager != null) {
+ drillDownCollectorOwner = new CollectorOwner<>(drillDownCollectorManager);
+ } else {
+ drillDownCollectorOwner = null;
+ }
- FacetsCollectorManager[] drillSidewaysFacetsCollectorManagers =
- new FacetsCollectorManager[numDims];
+ final List<CollectorOwner<?, ?>> drillSidewaysCollectorOwners = new ArrayList<>(numDims);
for (int i = 0; i < numDims; i++) {
- drillSidewaysFacetsCollectorManagers[i] = new FacetsCollectorManager();
+ drillSidewaysCollectorOwners.add(
+ new CollectorOwner<>(createDrillSidewaysFacetsCollectorManager()));
}
DrillSidewaysQuery dsq =
new DrillSidewaysQuery(
baseQuery,
- drillDownCollectorManager,
- drillSidewaysFacetsCollectorManagers,
+ drillDownCollectorOwner,
+ drillSidewaysCollectorOwners,
drillDownQueries,
scoreSubDocsAtOnce());
searcher.search(dsq, hitCollector);
FacetsCollector drillDownCollector;
- if (drillDownCollectorManager != null) {
- drillDownCollector = drillDownCollectorManager.reduce(dsq.managedDrillDownCollectors);
+ if (drillDownCollectorOwner != null) {
+ drillDownCollector = drillDownCollectorOwner.getResult();
} else {
drillDownCollector = null;
}
- FacetsCollector[] drillSidewaysCollectors = new FacetsCollector[numDims];
- int numSlices = dsq.managedDrillSidewaysCollectors.size();
-
+ final String[] drillSidewaysDims = query.getDims().keySet().toArray(new String[0]);
+ final FacetsCollector[] drillSidewaysCollectors = new FacetsCollector[numDims];
for (int dim = 0; dim < numDims; dim++) {
- List<FacetsCollector> facetsCollectorsForDim = new ArrayList<>(numSlices);
-
- for (int slice = 0; slice < numSlices; slice++) {
- facetsCollectorsForDim.add(dsq.managedDrillSidewaysCollectors.get(slice)[dim]);
- }
-
drillSidewaysCollectors[dim] =
- drillSidewaysFacetsCollectorManagers[dim].reduce(facetsCollectorsForDim);
+ (FacetsCollector) drillSidewaysCollectorOwners.get(dim).getResult();
Review Comment:
[nit] I think we can avoid casting here if we add types to `drillSidewaysCollectorOwners`, but given that this method is to be deprecated, I think it's fine to keep casting.
```
final List<CollectorOwner<FacetsCollector, FacetsCollector>> drillSidewaysCollectorOwners = ...
```
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Backport #13568 [lucene]
Posted by "stefanvodita (via GitHub)" <gi...@apache.org>.
stefanvodita commented on PR #13645:
URL: https://github.com/apache/lucene/pull/13645#issuecomment-2284385447
I'm surprised at how large the [spotless commit](https://github.com/apache/lucene/pull/13645/commits/fb2c0c50705a6a62bd93d4a270ad113a2e82283e) is. I assume it was just `gradlew tidy` and most code should have already been well formatted.
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Backport #13568 [lucene]
Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller merged PR #13645:
URL: https://github.com/apache/lucene/pull/13645
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Backport #13568 [lucene]
Posted by "gsmiller (via GitHub)" <gi...@apache.org>.
gsmiller commented on PR #13645:
URL: https://github.com/apache/lucene/pull/13645#issuecomment-2284392144
@stefanvodita
> I'm surprised at how large the [spotless commit](https://github.com/apache/lucene/pull/13645/commits/fb2c0c50705a6a62bd93d4a270ad113a2e82283e) is. I assume it was just gradlew tidy and most code should have already been well formatted.
I think what you're seeing is mainly where I had to manually resolve conflicts in the drill-sideways stuff and I was doing it in an editor that kind of botched whitespace, etc. There's a bit indentation change because of bulkScorer moving back out of scoreSupplier among some other stuff...
--
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: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org