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

Dirk Rudolph edited comment on OAK-7070 at 12/17/17 11:23 AM:
--------------------------------------------------------------

Ok in the query parsing there is a different issue: 

The SQL2Parser doesn't properly parse rep:excerpt(.) and 
rep:excerpt(propertyName), but expects EXCERPT as keyword, see 
[SQL2Parser.java#L902|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java#L902].
 So for example rep:excerpt(.) is interpreted as normal propertyName and goes 
to 
[SelectorImpl.java#L392|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java#L392]
 where its not taken into account due to checking for equality. 

I cannot find anything about the EXCERPT in the jcr-sql2 specs, but for facets 
there is nothing special in the SQL2Parser, so I assume we keep it like that as 
it is and adapt the SelectorImpl further instead. 


was (Author: diru):
Ok in the query parsing there is a different issue: 

The SQL2Parser doesn't properly parse rep:excerpt(.) and 
rep:excerpt(propertyName), but expects EXCERPT as keyword, see 
[SQL2Parser.java#L902|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java#L902].
 So for example rep:excerpt(.) is interpreted as normal propertyName and goes 
to 
[SelectorImpl.java#L392|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java#L392]
 where its not taken into account due to checking for equality. 

I cannot find anything about the EXCERPT in the jcr specs, but for facets there 
is nothing special in the SQL2Parser, so I assume we keep it like that as it is 
and adapt the SelectorImpl further instead. 

> rep:excerpt selector broken as regression of OAK-6750
> -----------------------------------------------------
>
>                 Key: OAK-7070
>                 URL: https://issues.apache.org/jira/browse/OAK-7070
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>    Affects Versions: 1.8
>            Reporter: Dirk Rudolph
>            Assignee: Vikas Saurabh
>
> The change made here:
> https://github.com/apache/jackrabbit-oak/commit/00c94b71293abcae6d76bb162c3f55c7d09b702e#diff-d4bdf443c61f24b634f33aab607e2114
> breaks the logic in line 676:
> {{else if (oakPropertyName.equals(QueryConstants.REP_EXCERPT + "("))}}
> This statement doesn't make much sense considering a query like {{select 
> \[rep:excerpt] from \[test:Page] as page where contains(\*, 'term\*')}} or 
> even {{select \[rep:excerpt(text)] from \[test:Page] as page where 
> contains(page.\[text], 'term\*')}}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to