You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2018/08/30 10:45:00 UTC

[jira] [Comment Edited] (OAK-5762) [Oak Lucene] Several full-text operators do not work (NOT, !, AND)

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

Thomas Mueller edited comment on OAK-5762 at 8/30/18 10:44 AM:
---------------------------------------------------------------

I think the documentation needs to be updated. Links:
* Contains: http://jackrabbit.apache.org/oak/docs/query/grammar-xpath.html#condition
* Fulltext: http://jackrabbit.apache.org/oak/docs/query/query-engine.html#Full-Text_Queries
* Lucene Syntax: https://lucene.apache.org/core/4_7_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html

For the cases above:
* AND is the default operator, so instead of {{'response AND layout'}} this works: {{'response layout'}}. This also works: {{'response \+layout'}}; both converted to {{\+(\+:fulltext:response \+:fulltext:layout)}}
* NOT is currently supported only using {{\-}} (as you noted), so instead of {{'response NOT layout'}} use {{'response \-layout'}}, converted to {{\-:fulltext:layout \+:fulltext:response}}
* {{'response !layout'}}: not sure what the intended behavior is... maybe NOT? This is not supported by Apache Lucene.
* {{'response OR layout'}}: this is working, converted to {{\+(:fulltext:response :fulltext:layout)}}


was (Author: tmueller):
I think the documentation needs to be updated. Links:
* Contains: http://jackrabbit.apache.org/oak/docs/query/grammar-xpath.html#condition
* Fulltext: http://jackrabbit.apache.org/oak/docs/query/query-engine.html#Full-Text_Queries
* Lucene Syntax: https://lucene.apache.org/core/4_7_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html

For the cases above:
* AND is the default operator, so instead of 'response AND layout' this works: 'response layout'. This also works: 'response +layout'; both converted to +(+:fulltext:response +:fulltext:layout)
* NOT is currently supported only using - (as you noted), so instead of 'response NOT layout' use 'response -layout', converted to -:fulltext:layout +:fulltext:response
* 'response !layout': not sure what the intended behavior is... maybe NOT? This is not supported by Apache Lucene.
* 'response OR layout': this is working, converted to +(:fulltext:response :fulltext:layout)

> [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
>            Assignee: Thomas Mueller
>            Priority: Major
>
> 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
(v7.6.3#76005)