-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add post-collection facets support to the new faceting API #15518
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
base: main
Are you sure you want to change the base?
Conversation
|
+1, thanks @epotyom -- this adds the capabilities of the first faceting impl (two-phased) to the new sandbox faceting engine? I'm curious about:
What's an example use-case? |
You are correct.
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 = |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No particular reason, fixed in the commit below, thanks!
stefanvodita
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for addressing the comment and for adding a changelog entry! I'm happy with the PR. For transparency: I've also reviewed this code when we committed it to Amazon's sources, so I'll wait a few days before pushing in case others want to review.
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