[ https://issues.apache.org/jira/browse/OAK-6926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16247588#comment-16247588 ]
Thomas Mueller commented on OAK-6926: ------------------------------------- Test case: {noformat} --- src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java (revision 1814727) +++ src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexQueryTest.java (working copy) @@ -219,6 +219,12 @@ assertXPathPlan("/jcr:root//*[jcr:contains(., '-*')]", planPrefix + "-:fulltext:* *:* ft:(-\"*\")"); + assertXPathPlan("/jcr:root//*[jcr:contains(., 'apple - pear')]", + planPrefix + "+:fulltext:apple -:fulltext:pear ft:(\"apple\" \"-\" \"pear\")"); + + assertXPathPlan("/jcr:root/content//*[jcr:contains(., 'apple - pear')]", + planPrefix + "+:fulltext:apple -:fulltext:pear +:ancestors:/content ft:(\"apple\" \"-\" \"pear\")"); + } private void assertXPathPlan(String xpathQuery, String expectedPlan) { {noformat} > Lucene: contains "a -b" with path restriction ignored "a" > --------------------------------------------------------- > > Key: OAK-6926 > URL: https://issues.apache.org/jira/browse/OAK-6926 > Project: Jackrabbit Oak > Issue Type: Bug > Components: lucene > Reporter: Thomas Mueller > Fix For: 1.8 > > > The following query is converted correctly: > {noformat} > /jcr:root//*[jcr:contains(., 'apple - pear')] > +:fulltext:apple -:fulltext:pear > BooleanQuery(BooleanClause(+,TermQuery(apple)), > BooleanClause(-,TermQuery(pear))) > {noformat} > However with path restriction, "apple" is lost: > {noformat} > /jcr:root/content//*[jcr:contains(., 'apple - pear')] > -:fulltext:pear +:ancestors:/content > BooleanQuery(BooleanClause(-,TermQuery(pear)), > BooleanClause(+,TermQuery(:ancestors:/content))) > {noformat} > This is related to OAK-3371. -- This message was sent by Atlassian JIRA (v6.4.14#64029)