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

Woonsan Ko commented on JCR-4339:
---------------------------------

Hey [~giacomolm],

According to \[1\], you shouldn't put '@' before element.
So, could you try this instead?

{code}
<index-rule nodeType="hippostd:html" 
condition="element(onsindexingproblem:content, 
hippostd:html)/@jcr:primaryType='{http://www.onehippo.org/jcr/hippostd/nt/2.0}html'">
 </index-rule>
{code}

You can also exclude the node by checking its parent node type as well:

    <index-rule nodeType="hippostd:html"
                condition="parent::element(*, 
onsindexingproblem:newsdocument)/@jcr:primaryType = 
'{http://www.onehippo.org/onsindexingproblem/nt/1.0}newsdocument'">
    </index-rule>

Regards,

Woonsan

\[1\] https://wiki.apache.org/jackrabbit/IndexingConfiguration

> Indexing configuration condition property seems to be broken 
> -------------------------------------------------------------
>
>                 Key: JCR-4339
>                 URL: https://issues.apache.org/jira/browse/JCR-4339
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>    Affects Versions: 2.16.0
>            Reporter: Giacomo Lamonaco
>            Assignee: Claus Köll
>            Priority: Major
>
> Hi, while upgrading jackrabbit library from 2.14 to 2.16 we noticed couple of 
> issues with the indexing configuration [1]. More specifically one of this 
> issue is related to the condition property. 
> While using the latest library the value of the condition property is totally 
> ignored, this means that the index-rule is applied to all nodes with the 
> specified nodetype.
> We did some investigations and maybe we found the root cause in this commit 
> [2]. More specifically, if you have a look at line 805 of the 
> IndexingConfigurationImpl, the appliesTo method is always returning true: it 
> looks not correct to me. 
> As a quick workaround we replace that line with:
> {code:java}
> return condition == null || condition.evaluate(state);{code}
> After this small fix the condition property in the index rules is working 
> again as expected. Please let us if this is a bug or a misunderstanding from 
> our side. 
> [1][https://wiki.apache.org/jackrabbit/IndexingConfiguration]
> [2][https://github.com/apache/jackrabbit/commit/a7804ede88623ceaa3b62f638f5384ebb97b39d4#diff-a79478132fc8ad1fe2bce5fa64f45310R805]
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to