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

Davide Giannella commented on OAK-2660:
---------------------------------------

with 
[4a5efe402378a5f82d78372a16ce7f25fce5e868|https://github.com/davidegiannella/jackrabbit-oak/commit/4a5efe402378a5f82d78372a16ce7f25fce5e868]
 managed to apply all the full-text conditions but the plain equality 
{{name='yes'}} is lost.

new plans:

{noformat}
16:30:51.904 [main] DEBUG o.a.j.oak.query.QueryEngineImpl - Parsing JCR-SQL2 
statement: SELECT * FROM [nt:unstructured] AS c WHERE ( c.[name] = 'yes' OR 
CONTAINS(c.[surname], 'yes') OR CONTAINS(c.[description], 'yes') ) AND 
ISDESCENDANTNODE(c, '/content') ORDER BY added DESC 
16:30:51.925 [main] DEBUG o.a.jackrabbit.oak.query.QueryImpl - cost using 
filter Filter(query=SELECT * FROM [nt:unstructured] AS c WHERE ( c.[name] = 
'yes' OR CONTAINS(c.[surname], 'yes') OR CONTAINS(c.[description], 'yes') ) AND 
ISDESCENDANTNODE(c, '/content') ORDER BY added DESC  fullText=surname:"yes" OR 
description:"yes", path=/content//*)
16:30:51.944 [main] DEBUG o.a.jackrabbit.oak.query.QueryImpl - cost for 
aggregate lucene is Infinity
16:30:51.948 [main] DEBUG o.a.jackrabbit.oak.query.QueryImpl - cost for 
lucene-property is 0.002
16:30:51.948 [main] DEBUG o.a.jackrabbit.oak.query.QueryImpl - cost for 
traverse is Infinity
16:30:51.949 [main] DEBUG o.a.jackrabbit.oak.query.QueryImpl - query execute 
SELECT * FROM [nt:unstructured] AS c WHERE ( c.[name] = 'yes' OR 
CONTAINS(c.[surname], 'yes') OR CONTAINS(c.[description], 'yes') ) AND 
ISDESCENDANTNODE(c, '/content') ORDER BY added DESC 
16:30:51.988 [main] DEBUG o.a.jackrabbit.oak.query.QueryImpl - query plan 
[nt:unstructured] as [c] /* lucene:test-index(/oak:index/test-index) 
full:surname:yes full:description:yes ordering:[{ propertyName : added, 
propertyType : UNDEFINED, order : DESCENDING }] ft:(surname:"yes" OR 
description:"yes") where isdescendantnode([c], [/content]) */
{noformat}

JUnit result:

{noformat}
java.lang.AssertionError: Expected path /content/test3 not found, got 
[/content/test1, /content/test2, /content/test4, /content/test5]
        at org.junit.Assert.fail(Assert.java:93)
        at org.junit.Assert.assertTrue(Assert.java:43)
...
{noformat}

> wrong resultset multiple ORs, lucene index, full-text
> -----------------------------------------------------
>
>                 Key: OAK-2660
>                 URL: https://issues.apache.org/jira/browse/OAK-2660
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 1.1.7
>            Reporter: Davide Giannella
>            Assignee: Davide Giannella
>             Fix For: 1.1.8
>
>
> When executing a query like 
> {code}
> SELECT * 
> FROM [nt:unstructured] AS c
>  WHERE ( c.[name] = 'yes' 
> OR CONTAINS(c.[surname], 'yes') 
> OR CONTAINS(c.[description], 'yes') ) 
> AND ISDESCENDANTNODE(c, '/content') 
> ORDER BY added DESC 
> {code}
> and a lucene property index is serving all the properties: {{name, surname, 
> description, added}} the full index is returned and no extra condition is 
> applied.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to