You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Julian Reschke (Jira)" <ji...@apache.org> on 2026/10/20 08:04:00 UTC

[jira] [Closed] (OAK-12344) ORDER BY: Lucene, Elastic and Oak's query engine sort missing and invalid values differently

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

Julian Reschke closed OAK-12344.
--------------------------------

> 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
>            Assignee: Thomas Mueller
>            Priority: Major
>             Fix For: 2.8.0
>
>
> 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) sort as 0 (the epoch), as do missing numbers and dates, so ORDER BY returns the wrong order.
>  - 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)