[ 
https://issues.apache.org/jira/browse/OAK-12344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anton Hosgood updated OAK-12344:
--------------------------------
    Summary: ORDER BY: Lucene, Elastic and Oak's query engine sort missing and 
invalid values differently  (was: Lucene and Elastic disagree on ORDER BY when 
an ordered value doesn't match the index-declared type)

> ORDER BY: Lucene, Elastic and Oak's query engine sort missing and invalid 
> values differently
> --------------------------------------------------------------------------------------------
>
>                 Key: OAK-12344
>                 URL: https://issues.apache.org/jira/browse/OAK-12344
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>            Reporter: Anton Hosgood
>            Priority: Major
>
> For an ordered property, the Lucene and Elastic indexes place nodes without a 
> usable value (property absent, or value not convertible to the declared type) 
> differently, and both differ from the query engine:
>  - Lucene: values not matching the declared type (e.g. non-ISO-8601 strings 
> for type=Date) are dropped. Missing numbers and dates sort as 0 (the epoch), 
> so ORDER BY returns the wrong order. If the ORDER BY is the only condition 
> the index can evaluate, the query returns no results.
>  - Elastic: missing values sort last in both directions.
>  - Query engine (traversal, union merges): missing values sort first in 
> ascending and last in descending order, as in Jackrabbit 2.
> As a result, the same query orders results differently depending on the 
> index, and union queries with ORDER BY on such a property can place these 
> nodes in the middle of the results on both backends.
> Follow-up to OAK-12343.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to