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

Adrien Grand commented on LUCENE-4858:
--------------------------------------

Thanks Shai, storing the Sorter is a good step forward to avoid traps. Now that 
SORTER_ID_PROP is added to the diagnostics, maybe that SORTED_DIAGNOSTICS_PROP 
is redundant?

I would like that we make the collector more robust too. Nothing prevent you 
from wrapping eg. a TotalHitCountCollector inside it. I've been thinking about 
adding an optional operation to Sorter that returns a oal.search.Sort that 
describes the index order so that we could hide all the early-termination 
complexity behind a custom IndexSearcher that could never return wrong results. 
This would make the API accessible to casual users while super-expert users 
could still write custom collectors if they need approximate results. But maybe 
we don't even need to provide an expert API given how straightforward it is to 
detect if the segment is sorted and to terminate the collection on a segment. 
What do you think?

I'll work on improving documentation as well.
                
> 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, 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

Reply via email to