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

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Reporter
  • 3,897
  • 5
  • 33
  • 47
  • 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 '12 at 06:44
  • @Kleenstar I need a query for AND and OR – Reporter Nov 28 '12 at 09: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 08 '12 at 21:03

1 Answers1

0

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

Kleenestar
  • 769
  • 4
  • 4