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

Adrien Grand commented on LUCENE-10269:
---------------------------------------

Actually the fact the we require values to be in order in the 1D case probably 
requires that the API visits nodes left to right, so I was probably wrong that 
it would put more constraints on implementations.

Maybe we should start by using the workaround you identified, and if we see it 
gain traction we can think of making it part of the public API with better 
performance?

> Add the ability to read KD trees from right to left
> ---------------------------------------------------
>
>                 Key: LUCENE-10269
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10269
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Ignacio Vera
>            Priority: Major
>
> In LUCENE-9820 we exposed a programatic API to navigate Lucene Kd-trees. It 
> is currently only possible to navigate those trees from left to right via the 
> methods #moveToChild and #moveToSibling.
>  
> In LUCENE-10262 we improve the Kd tree so we remove the constraint of having 
> to read the tree always forward. This added the possibility to introduce an 
> API to read the tree from right to left. This will allow for example to get 
> the maximum value for a dimension stored in a kd-tree that contains deleted 
> documents,
>  
> The idea will be something like:
>  
>  
> {code:java}
> /**
>  * Move to the first child node and return {@code true} upon success. Returns 
> {@code false} for
>  * leaf nodes and {@code true} otherwise.
>  */
> boolean moveToFirstChild() throws IOException;
> /**
>  * Move to the next sibling node and return {@code true} upon success. 
> Returns {@code false} if
>  * the current node is the last child.
>  */
> boolean moveToNextSibling() throws IOException; 
> /**
>  * Move to the last child node and return {@code true} upon success. Returns 
> {@code false} for
>  * leaf nodes and {@code true} otherwise.
>  */
> boolean moveToLastChild() throws IOException;
> /**
>  * Move to the previous sibling node and return {@code true} upon success. 
> Returns {@code false} if
>  * the current node is the first child.
>  */
> boolean moveToPreviousSibling() throws IOException;
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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

Reply via email to