Mohammad created OAK-9310:
-----------------------------

             Summary: Wrong result in Join query with contains condition
                 Key: OAK-9310
                 URL: https://issues.apache.org/jira/browse/OAK-9310
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: query
    Affects Versions: 1.32.0
            Reporter: Mohammad


I have problem with join query and contains condition. The condition is on join 
query but when query converted to solr query, the condtion applied on main 
type. When I change contains to equal the query convert and execute correctly.

After debugging I found this query has two execution plan. when The query 
engine select below plan it does not have any result but when use other plan it 
has result. This problem caused random result in search feature.

 

SQL2 query:

{{SELECT san_sinaBaseDossier.* FROM [san:lkeBaseDossier] AS san_lkeBaseDossier 
INNER JOIN [san:lkeBaseDocument] as san_lkeBaseDossier_san_documents ON 
san_lkeBaseDossier_san_documents.[jcr:uuid] = 
san_lkeBaseDossier.[san:documents] WHERE 
((CONTAINS([san_lkeBaseDossier_san_documents].[san:docDesc], cast('*123*' AS 
string)))) AND ISDESCENDANTNODE(san_lkeBaseDossier, '/contents/dossiers') ORDER 
BY [san_lkeBaseDossier].[jcr:createdBy] DESC}}

{{Converted solr query:}}
 
{{q.op=AND&fl=path_exact+score&df=catch_all&rows=10&sort=jcr\:createdBy_string_sort+desc&fq=(jcr\:primaryType:san\:lkeBaseDossier+)+&fq=path_des:\/contents\/dossiers&fq=\{!collapse+field%3Dpath_collapsed+min%3Dpath_depth+hint%3Dtop_fc+nullPolicy%3Dexpand}&q=*123*+san\:documents:*+}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to