[
https://issues.apache.org/jira/browse/OAK-12344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Anton Hosgood updated OAK-12344:
--------------------------------
Description:
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.
was:
For an ordered property index declared type=Date where some values aren't valid
dates, the two backends behave differently for the same query and data:
- Lucene: the value is dropped; ORDER BY returns the wrong order (values sort
as the epoch) or no results (numeric range matches nothing).
- Elastic: returns the rows with the offending values sorted last
(missing=_last).
The same index + query should behave the same on both backends.
Follow-up to OAK-12343.
> Lucene and Elastic disagree on ORDER BY when an ordered value doesn't match
> the index-declared type
> ---------------------------------------------------------------------------------------------------
>
> 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)