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

Anton Hosgood updated OAK-12434:
--------------------------------
    Description: 
For a Lucene property index with type=Date, Long or Double (without 
notNullCheckEnabled), an "is not null" condition on the property should return 
every node that has the property, as the query engine does when it evaluates 
the condition itself. Instead, the index misses:
- nodes whose value is not stored with a matching JCR type, e.g. dates stored 
as strings, whether valid ISO-8601 dates or not;
- for type=Double, nodes whose value is 0 or negative (the range starts at 
Double.MIN_VALUE, the smallest positive double).

This applies to explicit IS NOT NULL conditions and to conditions the query 
engine derives from them, e.g. from OR conditions on the property.

  was:
For a Lucene property index with type=Double, an IS NOT NULL condition on the 
property (e.g. select * from [nt:base] where [d] is not null) does not return 
nodes whose value is 0 or negative.

LucenePropertyIndex.createQuery builds the condition as 
NumericRangeQuery.newDoubleRange(name, Double.MIN_VALUE, Double.MAX_VALUE, 
true, true). Double.MIN_VALUE is the smallest positive double (4.9E-324), not 
the most negative one, so the range excludes 0 and all negative values. The 
Long/Date equivalents use Long.MIN_VALUE and are not affected.

Properties with notNullCheckEnabled=true are not affected, as they use a marker 
term instead.


> [Lucene] IS NOT NULL on Date/Long/Double properties misses nodes that have 
> the property
> ---------------------------------------------------------------------------------------
>
>                 Key: OAK-12434
>                 URL: https://issues.apache.org/jira/browse/OAK-12434
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: lucene
>            Reporter: Anton Hosgood
>            Priority: Major
>
> For a Lucene property index with type=Date, Long or Double (without 
> notNullCheckEnabled), an "is not null" condition on the property should 
> return every node that has the property, as the query engine does when it 
> evaluates the condition itself. Instead, the index misses:
> - nodes whose value is not stored with a matching JCR type, e.g. dates stored 
> as strings, whether valid ISO-8601 dates or not;
> - for type=Double, nodes whose value is 0 or negative (the range starts at 
> Double.MIN_VALUE, the smallest positive double).
> This applies to explicit IS NOT NULL conditions and to conditions the query 
> engine derives from them, e.g. from OR conditions on the property.



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

Reply via email to