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

Mayya Sharipova commented on LUCENE-9280:
-----------------------------------------

> Since DocValues are stored in docid order, how will skipping work? 

We have decided to do this similar how `LongDistanceFeatureQuery` works.  The 
initial iterator for a collector is indeed a docValues, but then as we set the 
bottom value in the comparator, the iterator is updated from PointValues to 
include only docs that are lower than bottom value (in case of asc sort). 

This is the most desirable for a case where docs were added sequentially with 
ever increasing values, e.g. a logging use case with an increasing date field. 
For example, if doc1 has a  field1 value 1, doc2 – 2, doc3 – 3,.... doc1000000 
– 1000000, and we needed to retrieve top 3 docs with smallest field1 values,  
currently we would iterate through all docs. With the proposed change, as soon 
as collect first 3 docs and set the bottom 3, the collector's iterator can be 
updated to remove all other docs as they are not competitive. 

 

> Add ability to skip non-competitive documents on field sort 
> ------------------------------------------------------------
>
>                 Key: LUCENE-9280
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9280
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Mayya Sharipova
>            Priority: Minor
>          Time Spent: 4.5h
>  Remaining Estimate: 0h
>
> Today collectors, once they collect enough docs, can instruct scorers to 
> update their iterators to skip non-competitive documents. This is applicable 
> only for a case when we need top docs by _score.
> It would be nice to also have an ability to skip non-competitive docs when we 
> need top docs sorted by other fields different from _score. 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to