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

Thomas Mueller commented on OAK-1215:
-------------------------------------

Thanks Marcel! In order to use an index on the property "size", the following 
changes are needed: the query engine would need to convert the query to a 
union. Currently the query is not converted to a union; revision 1556532 shows 
where the conversion could occur. The current conversion is:
{code}
xpath2sql /jcr:root/etc/commerce/products//*[@size='M' or x/@size='M']
select [jcr:path], [jcr:score], * from [nt:base] as a 
where ([size] = 'M' or [x/size] = 'M') 
and isdescendantnode(a, '/etc/commerce/products')
{code}

Then the query engine would need to support "\*/size" properties.

Then the index on "size" needs to be used. This could be done in the index. 
Even thought the property index can already do that if the child node name is 
known (as for "x/size"), it doesn't do it yet for "\*/size" and "\*/\*/size".


> Relative property paths don't work in XPath search expressions
> --------------------------------------------------------------
>
>                 Key: OAK-1215
>                 URL: https://issues.apache.org/jira/browse/OAK-1215
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>            Reporter: Jeff Young
>            Assignee: Thomas Mueller
>            Priority: Critical
>             Fix For: 0.15
>
>         Attachments: relative-predicate-paths.tiff
>
>
> A search XPath of the form:
> {code}
> /jcr:root/etc/commerce/products//*[@size='M' or */@size='M']
> {code}
> returns:
> {code}
> Invalid path: *
> {code}
> (This works fine in Jackrabbit.)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to