jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Querying on multi-value properties
Date Tue, 18 Dec 2007 13:18:21 GMT
Ard Schrijvers wrote:
>> Is this how it should work?
> I am not sure wether this is according specs. Anybody else?

the spec does not clearly specify how multi-valued properties are handled in a 
jcr:contains() function. it even says that jcr:contains() on a property is optional.

I don't think we can or should change the current behaviour. as a workaround I 
suggest to use individual nodes for authors. e.g. using infamous same-name siblings:

/books/addison-wesley/1995/design-patterns/author[1]/name = 'Erich Gamma'
/books/addison-wesley/1995/design-patterns/author[2]/name = 'Richard Helm'
/books/addison-wesley/1995/design-patterns/author[3]/name = 'Ralph E. Johnson'

the following query will not return results:

//element(my:book, )[jcr:contains(author/@name, 'erich helm')]

or without using SNS:

/books/addison-wesley/1995/design-patterns/authors/gamma/name = 'Erich Gamma'
/books/addison-wesley/1995/design-patterns/authors/helm/name = 'Richard Helm'
/books/addison-wesley/1995/design-patterns/authors/johnson/name = 'Ralph E. Johnson'

you would then have the following query:

//element(my:book, )[jcr:contains(authors/*/@name, 'erich helm')]


View raw message