You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Alan Woodward (Jira)" <ji...@apache.org> on 2020/05/26 10:12:00 UTC

[jira] [Commented] (LUCENE-9381) Extract necessary SortField methods into a new interface

    [ https://issues.apache.org/jira/browse/LUCENE-9381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17116592#comment-17116592 ] 

Alan Woodward commented on LUCENE-9381:
---------------------------------------

I opened a PR: https://github.com/apache/lucene-solr/pull/1537

Some comments:
* we still have a `getReverse()` method on SortOrder, but I'd like to remove that in a follow up - sort orders should be able to cope with ascending/descending sorts within their comparator functions.
* this makes Sort itself shallowly immutable, and as we move various sorts to implement SortOrder rather than extending SortField we can make them immutable as well.  It also removes a whole bunch of outdated javadoc on Sort, including my favourite doc line "you can re-use a Sort by changing its sort fields/this object is thread-safe"
* SortOrder has a name() method which is separate from its toString() implementation.  This is for distributed sorts to use as a key - toString() contains information about the source field, but also asc/desc and missing values, which you probably don't want when displaying sort values in results.

> Extract necessary SortField methods into a new interface
> --------------------------------------------------------
>
>                 Key: LUCENE-9381
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9381
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Alan Woodward
>            Assignee: Alan Woodward
>            Priority: Major
>
> Step 2 of LUCENE-9326.  SortField has a bunch of cruft on it that makes creating new sorts overly complicated.  This ticket will extract a new SortOrder interface from SortField that only contains the methods necessary for implementing a sort.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org