0

Currently I am stuck at the issue to generate a query with multiple paths. I could accomplish the situation searching for childnodes from a specific single rootpath in the crx repository. I use the keyword isdecendantnodenode() for that:

select * from [nt:base] as p
where
   (isdescendantnode (p, [first path])) 
   and contains(p.*, '"bankproducts"')
   and p.[sling:resourceType] = 'components/content/download'

As I said this works fine. Now I have to face the challenge searching for elements that does appear in two or more different childnodes - in the same hierarchy level.

My attempts to achieve that are following:

select * from [nt:base] as p
where
   (isdescendantnode (p, [first path]) and isdescendantnode(p, [second path]))
   and contains(p.*, '"bankproducts"')
   and p.[sling:resourceType] = 'components/content/download'

This gives me only the elements back they are only in the second path (in my eyes).

The next example results into a repository exception:

select * from [nt:base] as p
where
   (isdescendantnode (p, ([first path] and [second path]))
   and contains(p.*, ' "bankproducts"')
   and p.[sling:resourceType] = 'components/content/download'

May the order of keywords are wrong. I run out of ideas so SO belongs to the last options I've got.

Thanks in advance

3
  • Do you want to find elements in first path and second path, for example, en and de branches? In that case, you need use 'OR' in the path condition -- (isdescendantnode (p, [first path]) or isdescendantnode(p, [second path])). Ingore my comment if you are not looking for it.
    – Kleenestar
    Nov 28, 2012 at 6:44
  • @Kleenstar I need a query for AND and OR
    – Reporter
    Nov 28, 2012 at 9:30
  • You were right to connect multiple paths with OR. If you want you can convert you rnext to last sentence to an answer. I would accept as an answer.
    – Reporter
    Dec 8, 2012 at 21:03

1 Answer 1

0

Use 'OR' in the path condition -- (isdescendantnode (p, [first path]) or isdescendantnode(p, [second path])).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.