jpountz commented on PR #14775: URL: https://github.com/apache/lucene/pull/14775#issuecomment-2970793715
I'm unsure about this PR for a few reasons: 1. It sounds relatively easy to do on the application side by using `Sort` factories that can either produce a `Sort` object in the natural or inverse order and creating this `Sort` object at the last moment when we know what order is needed. 2. It doesn't seem to handle ties correctly, you probably need to append a `SortField` that sorts by descending doc ID, since Lucene tie-breaks by ascending doc ID by default. But then it's a bit annoying that the inverse `Sort` object produces different sort values compared with the original `Sort` object? 3. The handling of missing values probably needs changing, inversing a `SortField` on a String field that it configured to sort missing values last should probably sort missing values first and vice-versa? I wonder if there's a better way of doing this, maybe something like adding support for `searchBefore`, which would do the opposite of `searchAfter` (I'm thinking out loud, I having given much thoughts to this). -- 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