You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Woonsan Ko (JIRA)" <ji...@apache.org> on 2018/07/24 14:04:00 UTC

[jira] [Comment Edited] (JCR-4339) Indexing configuration condition property seems to be broken

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

Woonsan Ko edited comment on JCR-4339 at 7/24/18 2:03 PM:
----------------------------------------------------------

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:

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

Regards,

Woonsan

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


was (Author: woon_san):
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)