Search code examples
sqlworkspacemagnolia

How to create a Query to search at 2 workspaces in Magnolia?


I am trying to create a query so I can search for assets that have been published in Magnolia but that are inside of pages that had not been published.

I created a query for those assets that have been published to search inside the 'dam' repository wiht JRC-SQL2:

select p.* 
  from [mgnl:asset] as p 
 where (ISDESCENDANTNODE('/demo-features/tests') 
        or ISSAMENODE('/demo-features/tests')) 
   and (p.[mgnl:activationStatus] <> '')

but when I try to add any sort of extra condition to search in the 'website' repository in order to check if the asset exists there, I have been unable to create one that works.

I tried with UNION, IN, INNER JOIN, but because the information I seek it's in another repository Magnolia does not permit me to reach it.

Could any of you point me a way to reach information from 2 repositories at the same time?


Solution

  • Each workspace and each repository has it's own index. Therefore you can't combine searching over them in single query.