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

Robert Muir commented on LUCENE-5493:
-------------------------------------

Upon review of the APIs, I think ideal to the user is to remove these current 
"sorter/comparators" so that when you want to use sorting mergepolicy, you just 
pass it a normal org.apache.lucene.search.Sort. 

I know it seems a little crazy, but IMO the logic is duplicated. So someone 
should just be doing:
{code}
Sort sort = new Sort(new SortField("field1", SortField.Type.DOUBLE), new 
SortField(....));
iwc.setMergePolicy(mp, new SortingMergePolicy(sort));
{code}

This would let people be able to sort in reverse, by doubles/floats, by a 
combination of fields, expressions, whatever. And would deconfuse the API.

> Rename Sorter, NumericDocValuesSorter, and fix javadocs
> -------------------------------------------------------
>
>                 Key: LUCENE-5493
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5493
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>
> Its not clear to users that these are for this super-expert thing of 
> pre-sorting the index. From the names and documentation they think they 
> should use them instead of Sort/SortField.
> These need to be renamed or, even better, the API fixed so they aren't public 
> classes.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to