apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.45k stars 975 forks source link

Backport to 9x: Initialize facet counting data structures lazily #12408 #13300

Closed stefanvodita closed 1 month ago

stefanvodita commented 2 months ago

We can bring this optimisation from #12408 to 9x. It would make it easier to backport #12966 afterwards. I think the intention was to backport at first, since the CHANGES entry is under 9.8 in the commit.

stefanvodita commented 2 months ago

@gsmiller - I'd like your opinion as the author of the original commit. Am I missing some reason why we shouldn't backport?

github-actions[bot] commented 2 months ago

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!

stefanvodita commented 2 months ago

I went through this change once more to make sure it's safe to push. I would still like a second opinion, just in case I'm missing something, otherwise I'll merge this in a few days.

stefanvodita commented 2 months ago

Thank you for the review Mike! I did have to change a couple things:

  1. Added a new constructor to TaxonomyFacets, which takes a FacetsCollector, since I couldn't change the existing one.
  2. Updated TaxonomyFacetCounts too, which no longer exists on main.