jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roy Teeuwen <...@teeuwen.be>
Subject Re: XPath jcr:contains(.,\"value\") exlude one or more Properties
Date Sat, 04 Feb 2017 20:53:53 GMT
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 <roy@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 <mailto: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
> 


Mime
View raw message