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

ASF subversion and git services commented on LUCENE-10089:
----------------------------------------------------------

Commit 952747519494a07e2ef8ab3a30a2f3a22410b591 in lucene-solr's branch 
refs/heads/branch_8x from Mayya Sharipova
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=9527475 ]

LUCENE-10089: Disable numeric sort optimization early (#2576)

This commit moves the responsibility to disable
the numeric sort optimization on comparators to the SortField.
This way we don't need to apply the logic on every top field collectors.

Co-authored-by: Jim Ferenczi <[email protected]>

> Add a way to disable the sort optimizations to leverage points on numeric 
> fields
> --------------------------------------------------------------------------------
>
>                 Key: LUCENE-10089
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10089
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Priority: Minor
>             Fix For: main (9.0)
>
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> [~jimczi] [~romseygeek] [~mayya] and I were just looking at a case when it 
> would be useful to be able to disable the sort optimization.
> Say you have a 8.x index that has a field that is indexed with IntPoint and 
> NumericDocValuesField. This field is used for index sorting, and the 
> SortField is created with SortField.Type.LONG.
> This was accepted in 8.x, but this is something that Lucene 9 would complain 
> about: since the field is an integer, it should use SortField.Type.Int, not 
> SortField.Type.LONG. If the field was not used for index sorting, then you 
> could just switch to SortField.Type.INT and everything would work fine.
> However since the field is used for index sorting, if you switch to 
> SortField.Type.INT, then index-time SortField objects are going to compare 
> differently from search-time SortField objects, which in-turn will disable 
> early termination of queries in TopFieldCollector.
> To be able to migrate from indices that fall in this scenario, it would be 
> helpful to have an option that would disable the optimization to use points 
> as well as the associated validation logic, similarly to what we do in 8.x to 
> enable this optimization.



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

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

Reply via email to