You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Ze...@web.de on 2017/02/04 20:18:19 UTC
Re: XPath jcr:contains(.,\"value\") exlude one or more Properties
Hi,
thanks for your response. I know this normal search pattern in a specific property.
I was hoping there is something like a blacklist -> exclude one property but search all others without name theme explicit. It seems not ;-)
Greetings,
Michael
Re: XPath jcr:contains(.,\"value\") exlude one or more Properties
Posted by Roy Teeuwen <ro...@teeuwen.be>.
Just as an extra, seeing as JCR XPath is actually deprecated, you could also easily do it in JCR SQL2 ;)
select * from [nt:base] as s where contains(*,'myvalue') and not contains(myproperty, 'myvalue')
> On 4 Feb 2017, at 21:48, Roy Teeuwen <ro...@teeuwen.be> wrote:
>
> Hey Michael,
>
> You could do it by combining it, search all properties by using the '.' and then combine it with an and expression where you say myproperty does not contain myvalue (by prefixing it with a minus sign)
>
> For example: /jcr:root//*[jcr:contains(.,'myvalue') and jcr:contains(@myproperty,'-myvalue')]]
>
> You can find the specs for the jcr:contains here: https://docs.adobe.com/content/docs/en/spec/jcr/1.0/6.6.5.2_jcr_contains_Function.html <https://docs.adobe.com/content/docs/en/spec/jcr/1.0/6.6.5.2_jcr_contains_Function.html>
>
> Greets,
> Roy
>
>> On 4 Feb 2017, at 21:18, ZeroCool86@web.de <ma...@web.de> wrote:
>>
>> Hi,
>>
>> thanks for your response. I know this normal search pattern in a specific property.
>> I was hoping there is something like a blacklist -> exclude one property but search all others without name theme explicit. It seems not ;-)
>>
>> Greetings,
>> Michael
>
Re: XPath jcr:contains(.,\"value\") exlude one or more Properties
Posted by Roy Teeuwen <ro...@teeuwen.be>.
Hey Michael,
You could do it by combining it, search all properties by using the '.' and then combine it with an and expression where you say myproperty does not contain myvalue (by prefixing it with a minus sign)
For example: /jcr:root//*[jcr:contains(.,'myvalue') and jcr:contains(@myproperty,'-myvalue')]]
You can find the specs for the jcr:contains here: https://docs.adobe.com/content/docs/en/spec/jcr/1.0/6.6.5.2_jcr_contains_Function.html <https://docs.adobe.com/content/docs/en/spec/jcr/1.0/6.6.5.2_jcr_contains_Function.html>
Greets,
Roy
> On 4 Feb 2017, at 21:18, ZeroCool86@web.de wrote:
>
> Hi,
>
> thanks for your response. I know this normal search pattern in a specific property.
> I was hoping there is something like a blacklist -> exclude one property but search all others without name theme explicit. It seems not ;-)
>
> Greetings,
> Michael