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

Michael McCandless commented on LUCENE-3918:
--------------------------------------------

Wow, big patch!  It looks good!  Some comments:

  * Can you change indent to 2 spaces (not tab)?

  * I see two compilation errors:
{noformat}
    [javac] Compiling 31 source files to 
/l/indexsorter/lucene/build/misc/classes/java
    [javac] 
/l/indexsorter/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingDocsAndPositionsEnum.java:49:
 error: diamond operator is not supported in -source 1.6
    [javac]     private final Map<Integer, Position[]> newPositions = new 
HashMap<>();
    [javac]                                                                     
  ^
    [javac]   (use -source 7 or higher to enable diamond operator)
    [javac] 
/l/indexsorter/lucene/misc/src/java/org/apache/lucene/index/sorter/SortingDocsEnum.java:37:
 error: diamond operator is not supported in -source 1.6
    [javac]             final List<Integer> newDocIds = new ArrayList<>();
    [javac]                                                           ^
    [javac]   (use -source 7 or higher to enable diamond operator)
{noformat}

  * I'm confused: shouldn't SortingIndexReader.document use a
    newToOld[docID] instead of oldToNew[docId]?  Same with other
    places, eg SortingSource.getBytes/Float/etc. (At least the 3.6.x
    version seems to do that...).

  * These new impl seems to be ... rather memory intensive?  Eg
    SortingDocsEnum allocates List<Integer>, reads in all docs for
    this term up front, sorts them, and keeps Integer[] for iterating
    over.  Sorter.oldToNew impls allocate new Doc[maxDoc] ... the 3.6
    impl seemed somewhat more RAM efficient (left things on disk and
    seek'd on each lookup).  I don't think this is a showstopper
    ... but it may limit how large an index this can practically run
    on ... but I guess requiring high RAM to sort may be OK ...

  * Some places seem to open a DirectoryReader but not close it, eg
    DocumentSorter.oldToNew.

  * It's nice that you can sort by anything now ... first payload, doc
    values, stored fields, etc.

                
> Port index sorter to trunk APIs
> -------------------------------
>
>                 Key: LUCENE-3918
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3918
>             Project: Lucene - Core
>          Issue Type: Task
>          Components: modules/other
>    Affects Versions: 4.0-ALPHA
>            Reporter: Robert Muir
>             Fix For: 4.2, 5.0
>
>         Attachments: LUCENE-3918.patch
>
>
> LUCENE-2482 added an IndexSorter to 3.x, but we need to port this
> functionality to 4.0 apis.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to