gsmiller opened a new pull request #543: URL: https://github.com/apache/lucene/pull/543
# Description This change allows users to provide custom multi-valued "value sources" for numeric faceting (`LongValueFacetCounts`, `LongRangeFacetCounts` and `DoubleRangeFacetCounts`). Without this change, users are restricted to single-valued custom sources (as opposed to filed-based faceting that can support single- or multi-valued documents). # Solution I added new multi-valued versions of `DoubleValues(Source)` and `LongValues(Source)` with support for them in the above-mentioned faceting classes. I originally pursued a different solution where I allowed users to provide their own `SortedNumericDocValues` instances to these faceting classes but it didn't seem like a good fit. Providing a `xxDocValues` instance requires custom value providers to support document iteration (i.e., implement `DocValuesIterator` / `DocIdSetIterator` contracts), which may not always be possible. In particular, because the existing `(Double/Long)Values` classes don't require iteration capabilities, it's not straight-forward to wrap them with a `SortedNumericDocValues` instance. # Tests I've added new tests for `Multi(Long/Double)ValuesSource` and updated faceting testing to exercise the new code-paths during random testing. # Checklist Please review the following and check all that apply: - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/lucene/HowToContribute) and my code conforms to the standards described there to the best of my ability. - [x] I have created a Jira issue and added the issue ID to my pull request title. - [x] I have given Lucene maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended) - [x] I have developed this patch against the `main` branch. - [x] I have run `./gradlew check`. - [x] I have added tests for my changes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org