You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Andrea Polci <an...@exmachina.ch> on 2011/03/07 10:18:26 UTC
XPath: multiple condition on child node
Actually I have a query similar to this one:
/jcr:root//element(*,exm:document)[exm:feature/@exm:prop1='value1' and
exm:feature/@exmp:prop2 = 'value2']
The problem is that a "exm:document" node can have multiple
"exm:feature" childs and the two conditions can match different
childs.
For example I don't want the query to match a document like this:
document/feature1/prop1='value1'
document/feature1/prop2='xxxx'
document/feature2/prop1='yyyy'
document/feature2/prop2='value2'
while I want to match this one:
document/feature1/prop1='value1'
document/feature1/prop2='value2'
document/feature2/prop1='xxxx'
document/feature2/prop2='yyyy'
Is there a way to obtain this?
Thanks,
Andrea Polci
Re: XPath: multiple condition on child node
Posted by Ard Schrijvers <a....@onehippo.com>.
I don't think it is possible to query in jackrabbit the you want. You
might want to change your content model for it.
Also, to emphasize the complexity of what you want: Lucene has a
bleeding edge feature improvement planned for the 4.x, called
NestedDocumentQuery, see
https://issues.apache.org/jira/browse/LUCENE-2454
This explains the complexity behind what you want. Also take a look at
the presentation link in the issue regarding cross-matching. Quite
enlightening by the way.
Regards Ard
On Mon, Mar 7, 2011 at 10:18 AM, Andrea Polci <an...@exmachina.ch> wrote:
> Actually I have a query similar to this one:
> /jcr:root//element(*,exm:document)[exm:feature/@exm:prop1='value1' and
> exm:feature/@exmp:prop2 = 'value2']
>
> The problem is that a "exm:document" node can have multiple
> "exm:feature" childs and the two conditions can match different
> childs.
>
> For example I don't want the query to match a document like this:
>
> document/feature1/prop1='value1'
> document/feature1/prop2='xxxx'
> document/feature2/prop1='yyyy'
> document/feature2/prop2='value2'
>
> while I want to match this one:
>
>
> document/feature1/prop1='value1'
> document/feature1/prop2='value2'
> document/feature2/prop1='xxxx'
> document/feature2/prop2='yyyy'
>
> Is there a way to obtain this?
>
> Thanks,
> Andrea Polci
>
--
Hippo
Europe • Amsterdam Oosteinde 11 • 1017 WT Amsterdam • +31 (0)20 522 4466
USA • San Francisco 755 Baywood Drive, Second Floor • Petaluma, CA.
94954 • +1 877 414 4776 (toll free)
Canada • Montréal 5369 Boulevard St-Laurent #430 • Montréal QC
H2T 1S5 • +1 (514) 316 8966
www.onehippo.com • www.onehippo.org • info@onehippo.com
________________________________________________________________
This e-mail may be privileged and/or confidential, and the sender does
not waive any related rights and obligations. Any distribution, use or
copying of this e-mail or the information it contains by other than an
intended recipient is unauthorized. If you received this e-mail in
error, please advise me (by return e-mail or otherwise) immediately.