Drill-down faceting query should not affect other facet counts

Description

Using the "drill-down" function in faceting should - at least by default - behave like Amazon's faceting: it affects the filtering of the list shown as current results but should not affect the faceting count of other facets.
(It will of course affect sub-facets, so people can navigate up/down the facet tree to narrow down the results and explore different branches, but the parent branch and it's peers shouldn't be affected.

It's still possible to apply global filters which affect all facets (like a filter applied on root): example enable "only items with at least 4 star reviews" might affect all counters in the tree.
But if I'm in the area "TVs", and then the options {"LED", "Plasma"} open up, when we select "LED" the counters for both "Plasma" and "LED" should not change -> just of course the main results list will show only LED televisions.

For those people who think it should be possible to affect such a drill down feature as a filter, they can still apply the filter globally (on the root query).

<emmanuel> but to move forward, let's start with what we have. It seems that such alternative are definitely going to be an option on the FacetedManager
<emmanuel> facetedManager.countAs(AMAZON)

Activity

Show:

Yoann Rodière April 14, 2022 at 2:14 PM

This problem is still relevant in Hibernate Search 6, where faceting drill-down is not built-in, and developers are supposed to just add predicates to perform drill-down.

Currently if we want the drill-down to affect the hits and other aggregations, but not the aggregation we’re drilling down on, the only solution is to re-execute the query for each aggregation we want to drill down on. (see )

We should probably provide an API to enable a drill-down with implicit query re-execution for aggregations.

For example:

The signature of drillDown would probably be something like this:

As to the implementation:

  • The drill-down filter would be implemented with a terms predicate for the terms aggregation, and a range predicate for the range aggregation.

  • on Lucene I think our only choice would be to re-execute the query for each aggregation that includes a drill-down.

  • on Elasticsearch we might be able to implement a drilled-down aggregation as a global aggregation containing an inner filter aggregation with the actual terms/range aggregation inside the filter aggregation. The filter aggregation would use the main query as filter as well as any drill-down from other aggregations.

Details

Assignee

Reporter

Labels

Components

Priority

Created March 14, 2011 at 9:09 PM
Updated September 25, 2023 at 3:26 PM