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 "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2015/01/22 15:08:34 UTC

[jira] [Resolved] (OAK-2439) IndexPlanner returning plan for queries involving jcr:score

     [ https://issues.apache.org/jira/browse/OAK-2439?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chetan Mehrotra resolved OAK-2439.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.0.10

Done 
* trunk - http://svn.apache.org/r1653849
* 1.0 - http://svn.apache.org/r1653865

> IndexPlanner returning plan for queries involving jcr:score
> -----------------------------------------------------------
>
>                 Key: OAK-2439
>                 URL: https://issues.apache.org/jira/browse/OAK-2439
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: oak-lucene
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>             Fix For: 1.0.10, 1.1.6
>
>
> Consider a query like 
> {noformat}
> /jcr:root//element(*, cq:Taggable)[ (@cq:tags = 'geometrixx-outdoors:activity/biking' or @cq:tags = '/etc/tags/geometrixx-outdoors/activity/biking') ] order by @jcr:score descending
> {noformat}
> And a seemingly non related index like
> {noformat}
> /oak:index/assetType
>   ...
>   - type = "lucene"
>   + indexRules
>     + nt:base
>       + properties
>         + assetType
>           - propertyIndex = true
>           - name = "assetType"
> {noformat}
> Then currently {{IndexPlanner}} would return a plan because even when it cannot evaluate any of property restrictions because it thinks it can sort on {{jcr:score}}. This later results in an exception like
> {noformat}
> 14.01.2015 16:16:35.866 *ERROR* [0:0:0:0:0:0:0:1 [1421248595863] POST /bin/tagcommand HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught Throwable
> java.lang.IllegalStateException: No query created for filter Filter(query=select [jcr:path], [jcr:score], * from [cq:Taggable] as a where [cq:tags] in('geometrixx-outdoors:activity/swimming', '/etc/tags/geometrixx-outdoors/activity/swimming') and isdescendantnode(a, '/') order by [jcr:score] desc /* xpath: /jcr:root//element(*, cq:Taggable)[ (@cq:tags = 'geometrixx-outdoors:activity/swimming' or @cq:tags = '/etc/tags/geometrixx-outdoors/activity/swimming') ] order by @jcr:score descending */, path=//*, property=[cq:tags=in(geometrixx-outdoors:activity/swimming, /etc/tags/geometrixx-outdoors/activity/swimming)])
> 	at org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex.getQuery(LucenePropertyIndex.java:505)
> 	at org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex.access$200(LucenePropertyIndex.java:158)
> 	at org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$1.loadDocs(LucenePropertyIndex.java:303)
> 	at org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$1.computeNext(LucenePropertyIndex.java:261)
> 	at org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$1.computeNext(LucenePropertyIndex.java:253)
> 	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)