WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@epotyom
Copy link
Contributor

@epotyom epotyom commented Dec 23, 2025

Add post-collection facets support to the new faceting API.

Normally, users can collect facets directly during search without needing FacetsCollector to store doc IDs. However, this class implements the second step of two-step collection: iterating over doc IDs already collected in FacetsCollector to compute facet results. This approach is useful when all matches must be known before computing facets, or when reusing the same matching documents to run faceting multiple times.

Source: Facets during collection development plan

@mikemccand
Copy link
Member

+1, thanks @epotyom -- this adds the capabilities of the first faceting impl (two-phased) to the new sandbox faceting engine?

I'm curious about:

when all matches must be known before computing facets

What's an example use-case?

@epotyom
Copy link
Contributor Author

epotyom commented Dec 24, 2025

+1, thanks @epotyom — this adds the capabilities of the first faceting impl (two-phase) to the new sandbox faceting engine?

You are correct.

when all matches must be known before computing facets

What's an example use-case?

In Amazon product search, we want to add support for rank-dependent associative facets, e.g. sorting facets by max doc relevance, where the relevance expression depends on the ranks of the top-N matching documents. Other potential use cases that come to mind are dynamic ranges (which require numeric values for all matches before they can be computed), and percentile aggregates for facets. Note that this change isn’t the only thing we need to integrate these features with the new faceting API, but it enables them in the future.

drillSidewaysManagers.put("dim1", new DocCountCollectorManager());

// Use multi-threaded executor
java.util.concurrent.ExecutorService executor =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't normally import classes this way. Is there a reason for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants