SOLR-12457: improve compatibility/support for sort by field-function
See: SOLR-12457 Continuation of: https://github.com/apache/lucene-solr/pull/989
Affects marshal/unmarshal of sort values for field-function sorts, native numeric wrapper for multivalued Trie field docValues, and missingValue (sortMissingFirst/sortMissingLast) wrt field-function sort.
Cleaned this up quite a bit.
The essence of what's happening here is pretty straightforward:
- ValueSources need to supply their own SortField, but in Solr they need to supply a SortField that is aware of missing values, etc., so we wrap Lucene ValueSource impls to delegate getSortField() to the Solr FieldType.
- We leverage
FieldCacheSource(which I finally now think I understand its purpose) to determine when/how to do specialized marshalling/unmarshalling of sort values.
That's it!
I plan (pending feedback/approval) to add some javadocs to Lucene FieldCacheSource clarifying its uses, and change Lucene JoinDocFreqValueSource so that it no longer extends FieldCacheSource (I think it never should have). Assuming that goes as I anticipate, we'll be able to remove the special-case for JoinDocFreqValueSource in SortSpecParsing. If it doesn't go as I anticipate, will re-evaluate and decide how to proceed.
Hi @magibney . I got a question about this bug from a client. Do you remember why this was not merged back in May'22?
This PR had no visible activity in the past 60 days, labeling it as stale. Any new activity will remove the stale label. To attract more reviewers, please tag someone or notify the [email protected] mailing list. Thank you for your contribution!