solr icon indicating copy to clipboard operation
solr copied to clipboard

SOLR-12457: improve compatibility/support for sort by field-function

Open magibney opened this issue 3 years ago • 1 comments

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.

magibney avatar Apr 29 '22 17:04 magibney

Cleaned this up quite a bit.

The essence of what's happening here is pretty straightforward:

  1. 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.
  2. 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.

magibney avatar May 04 '22 22:05 magibney

Hi @magibney . I got a question about this bug from a client. Do you remember why this was not merged back in May'22?

janhoy avatar Mar 14 '23 13:03 janhoy

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!

github-actions[bot] avatar Feb 20 '24 00:02 github-actions[bot]