Paul Cowan (JIRA | 4 Mar 07:10 2009  [jira] Updated:
(LUCENE-1372) Proposal: introduce more sensible sorting when a
doc has multiple values for a term       [ ]  Paul Cowan updated
LUCENE-1372:      Attachment:
LUCENE-1372-MultiValueSorters.patch  I think we're after
somewhat different things here Uwe, but still pulling generally
in the same direction.  For your case, I personally am in favour
of: 1) replacing (as I did in my original patch) the loops in
FieldCacheImpl that look like this: {code}while ( {
retArray[termDocs.doc()] = termval; with ones that look like
this: {code}while ( {    if (retArray[termDocs.doc() == null) {
retArray[termDocs.doc()] = termval; (or == 0 for the int case,
== 0.0 for the float case, whatever). This, I think, meets your
sorting goal (order by lexicographically first term using simple
binary ordering of the term text). You then just need either: a)
a code path that uses FieldCacheImpl.getStrings() rather than
than .getStringIndex() (the former doesn't care about the mor