[
https://issues.apache.org/jira/browse/OAK-9310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17261797#comment-17261797
]
Mohammad commented on OAK-9310:
-------------------------------
I add selector equality check in FullTextSearchImpl class like above patch
file. Then the reported bug solved. Does this change have any side effects?
> 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
> Priority: Major
> Attachments:
> Selector_equality_added_in_fulltext_search_restriction_because_of_wrong_filtering_in_join_.patch,
> container.log
>
>
> 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:
> {noformat}
> 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}}
> {noformat}
> Converted solr query:
> {noformat}
> 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:*+
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)