[ https://issues.apache.org/jira/browse/LUCENE-4858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13618349#comment-13618349 ]
Adrien Grand commented on LUCENE-4858: -------------------------------------- I like making it more robust by ensuring the segment is sorted and not only the result from a merge! Maybe we could even go further and add an identifier of the Sorter which has been used to sort the segment. This way, early query termination could keep working correctly even if the user decides to change the sort order of the index? bq. This still does not address addIndexes. I think it will be good if we can have a SortingEarlyTerminationCollector which works with both modes. I'll try that later. I'm still thinking about whether IndexWriter should sort the provided readers in addIndexes. On the one hand, I understand that given that the user can wrap the readers with a SortingAtomicReader himself, there is little added value in sorting the readers in addIndexes. But on the other hand, this method "merges the provided indexes into this index" (quoting the javadocs) so not sorting the readers while a SortingMergePolicy is used feels like the MergePolicy is being bypassed. So net/net I think I prefer making addIndexes sort the readers and have a dedicated method in MergePolicy to handle addIndexes? (And this would make it easy to add additional diagnostic to the segments resulting from a call to addIndexes.) > Early termination with SortingMergePolicy > ----------------------------------------- > > Key: LUCENE-4858 > URL: https://issues.apache.org/jira/browse/LUCENE-4858 > Project: Lucene - Core > Issue Type: Improvement > Reporter: Adrien Grand > Assignee: Adrien Grand > Priority: Minor > Fix For: 4.3 > > Attachments: LUCENE-4858.patch, LUCENE-4858.patch > > > Spin-off of LUCENE-4752, see > https://issues.apache.org/jira/browse/LUCENE-4752?focusedCommentId=13606565&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13606565 > and > https://issues.apache.org/jira/browse/LUCENE-4752?focusedCommentId=13607282&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13607282 > When an index is sorted per-segment, queries that sort according to the index > sort order could be early terminated. -- 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: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org