-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should the static search methods in FacetsCollector take a FacetsCollector as last argument? #13725
Comments
My vote would be to be more restrictive with these signatures and specify |
I agree @gsmiller , I am inclined to be stricter. Also, while we make this breaking change, we can go directly from |
We have a few public static utility search methods in FacetsCollector that accept a Collector as last argument. In practice, these are expected to be called providing a `FacetsCollector` as last argument. Also, we'd like to remove all the search methods that take a `Collector` in favour of those that take a `CollectorManager` (see apache#12892). This commit adds the corresponding functionality to `FacetsCollectorManager`. The new methods take a `FacetsCollectorManager` as last argument. The return type has to be adapted to include also the facets results that were before made available through the collector argument. In order for tests to all work I had to add support for `keepScores` to `FacetsCollectorManager` which was missing. Closes apache#13725
I have bumped into this and wondered for a while, why do the following methods take a generic
Collector
as last argument?Are these methods ever called providing a collector that's not an instance of
FacetsCollector
? If so, should these methods to be moved to a more appropriate location, outside ofFacetsCollector
? If not, should that argument becomeFacetsCollector
?This is somewhat related to #12892 in that if we want to remove
search(Query, Collector)
we need to get rid of the usages in these static methods. We can either change the signature of these methods to take a genericCollectorManager
, or aFacetsCollectorManager
if we decide that it's more appropriate to restrict the type of accepted collectors.The text was updated successfully, but these errors were encountered: