[ https://issues.apache.org/jira/browse/OAK-5762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Gonzalez updated OAK-5762: -------------------------------- Description: The following fulltext operators do not appear to be evaluated correctly. AND operator {noformat} QUERY: /jcr:root/content/docs/en/aem/_x0036_-3//element(*, cq:Page)[(jcr:contains(., 'response AND layout'))]/rep:excerpt(.) PLAN: [cq:Page] as [a] /* lucene:cqPageLucene(/oak:index/cqPageLucene) +(+:fulltext:respons +:fulltext:and +:fulltext:layout) +:ancestors:/content/docs/en/aem/6-3 ft:("response" "AND" "layout") where (contains([a].[*], 'response AND layout')) and (isdescendantnode([a], [/content/docs/en/aem/6-3])) */ {noformat} NOT operator {noformat} QUERY: /jcr:root/content/docs/en/aem/_x0036_-3//element(*, cq:Page)[(jcr:contains(., 'response NOT layout'))]/rep:excerpt(.) PLAN: [cq:Page] as [a] /* lucene:cqPageLucene(/oak:index/cqPageLucene) +(+:fulltext:respons +:fulltext:not +:fulltext:layout) +:ancestors:/content/docs/en/aem/6-3 ft:("response" "NOT" "layout") where (contains([a].[*], 'response NOT layout')) and (isdescendantnode([a], [/content/docs/en/aem/6-3])) */ {noformat} ! operator {noformat} QUERY: /jcr:root/content/docs/en/aem/_x0036_-3//element(*, cq:Page)[(jcr:contains(., 'response !layout'))]/rep:excerpt(.) PLAN: [cq:Page] as [a] /* lucene:cqPageLucene(/oak:index/cqPageLucene) +(+:fulltext:respons +:fulltext:layout) +:ancestors:/content/docs/en/aem/6-3 ft:("response" "!layout") where (contains([a].[*], 'response !layout')) and (isdescendantnode([a], [/content/docs/en/aem/6-3])) */ {noformat} Note the `-` operator works. was: The following 3 full-text queries return the same results. I expected the 1st to be different from the 2nd and 3rd, but the 2nd and 3rd should be identical to one another. All 3 yield the same results. {noformat} dog AND cat {noformat} {noformat} dog AND NOT cat {noformat} {noformat} dog AND !cat {noformat} The following (which, IIUC is the equivalent to NOT and !) does yield expected results. {noformat} dog AND -cat {noformat} > [Oak Lucene] Several full-text operators do not work (NOT, !, AND) > ------------------------------------------------------------------ > > Key: OAK-5762 > URL: https://issues.apache.org/jira/browse/OAK-5762 > Project: Jackrabbit Oak > Issue Type: Bug > Components: lucene > Affects Versions: 1.6.0 > Reporter: David Gonzalez > > The following fulltext operators do not appear to be evaluated correctly. > AND operator > {noformat} > QUERY: /jcr:root/content/docs/en/aem/_x0036_-3//element(*, > cq:Page)[(jcr:contains(., 'response AND layout'))]/rep:excerpt(.) > PLAN: [cq:Page] as [a] /* lucene:cqPageLucene(/oak:index/cqPageLucene) > +(+:fulltext:respons +:fulltext:and +:fulltext:layout) > +:ancestors:/content/docs/en/aem/6-3 ft:("response" "AND" "layout") where > (contains([a].[*], 'response AND layout')) and (isdescendantnode([a], > [/content/docs/en/aem/6-3])) */ > {noformat} > NOT operator > {noformat} > QUERY: /jcr:root/content/docs/en/aem/_x0036_-3//element(*, > cq:Page)[(jcr:contains(., 'response NOT layout'))]/rep:excerpt(.) > PLAN: [cq:Page] as [a] /* lucene:cqPageLucene(/oak:index/cqPageLucene) > +(+:fulltext:respons +:fulltext:not +:fulltext:layout) > +:ancestors:/content/docs/en/aem/6-3 ft:("response" "NOT" "layout") where > (contains([a].[*], 'response NOT layout')) and (isdescendantnode([a], > [/content/docs/en/aem/6-3])) */ > {noformat} > ! operator > {noformat} > QUERY: /jcr:root/content/docs/en/aem/_x0036_-3//element(*, > cq:Page)[(jcr:contains(., 'response !layout'))]/rep:excerpt(.) > PLAN: [cq:Page] as [a] /* lucene:cqPageLucene(/oak:index/cqPageLucene) > +(+:fulltext:respons +:fulltext:layout) +:ancestors:/content/docs/en/aem/6-3 > ft:("response" "!layout") where (contains([a].[*], 'response !layout')) and > (isdescendantnode([a], [/content/docs/en/aem/6-3])) */ > {noformat} > Note the `-` operator works. -- This message was sent by Atlassian JIRA (v6.3.15#6346)