apache / apache/lucene

Implement "flattened" Facets#getTopChildren [LUCENE-10547]

Open
#11,583 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Minor module:facet type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

The currently implementation of `Facets#getTopChildren` only considers the immediate children of the user-provided path. In many cases, this is probably what the user is looking for, but it would be useful to also have an implementation that considers any descendant of the path, regardless of "level." This would allow the user to build a deeper set of facet path options in "one shot," instead of having to iteratively call `getTopChildren`.

Of course the shallower paths, and specifically the immediate children of the provided path, will always outweigh "deeper" paths due to counts/weights accumulating along the ancestry paths, but by providing a topN value larger than the number of immediate children, the user could build up a more complete view of path options in a taxonomy with a lot of depth.

---
Migrated from [LUCENE-10547](https://issues.apache.org/jira/browse/LUCENE-10547) by Greg Miller (@gsmiller)

Contributor guide

Open the contributing guide

Research direction

Start at the Facets#getTopChildren entry point and review how it currently considers immediate children of a user-provided path. Define the flattened behavior so descendants at any depth compete by their accumulated counts, while shallower paths remain preferred. Done means a topN larger than the immediate-child count can return additional descendant facet paths in the expected order.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.