Searching in Referenced Objects

Hi there,

I have a main schema and a referenced schema. I have no trouble getting

a) getting all data from the main schema, including the derefernced data from the reference schema, satisfying a condition in the main schema.

b) getting all the object instances from the referenced schema given a condition in the referenced schema


I cannot (so far) define a query where I get all results from the main schema and the referenced schema given a condition in the main schema and a condition in the referenced schema.

I’ll attach my example schemas and object instances.

This query covers case a. from above:


This query covers case b. from above:

doxBankingDoc/doxAppDocElements/doxAppDocElements[isDeleted=“1” ]

My problem, I want to merge both queries, getting all the object instances from both schemas where

doxId=“e56aeb761e-0010-9387” and isDeleted=“1”

Any help is greatly appreciated. :slight_smile: (5.26 KB)

I assume you’re talking about “document composition”?

I had this same problem and opened a ticket on it on the support site. I was told, that this (queries on data in both schemas) did not work, was not meant to work, and there was no plan to make it work. To quote the reply passed on to me from Germany (my sample used the example jazzMusian schemas from the documentation):

"We were able to reproduce the scenario with the sample data: the filter in the first query crosses the border from the referencing jazzMusician node to the referenced jazzMusician document. This is not allowed in joining documents and not planned as a feature due to processor restrictions.

“Usually, this feature is sufficient as the results can be processed further by applications, e.g. to just displaying the collaboration node rather than the whole joined document.”

I find this very unfortunate. Document composition that merely saves me the trouble of assembling documents in application code isn’t all that useful. Joining them in code is easy. However searches (and therefor indexing) that operates transparently across document references would be an EXTREMELY powerful and useful feature.

I hope enough users demand this to get SoftwareAG to reconsider.

The reason that you cannot filter in the joined doctype is because the the primary schema defines a static query to resolve the secondary (joined) doctype.

I believe XQuery support will be available in the next major release (to what degree I don’t know - sorry I don’t know any specific details) and XQuery has the ability to perform joins. With XQuery it should be possible to query two different document types in the manner originally described and merge the results together in exactly the way you want. If this is delivered in the next major release of Tamino this probably explains the response from Software AG support.

Because it the join IS static, there is not reason that indices could not be built across it–i.e. that index the composed document not just the refernceing and reference documents seperated.

Regardless whether it is XQuery or XPath used to do the search, the important thing for good performance will be whether the indexing is done on the post-composition (joined) document or just the parts. It seems to me that joining the result sets of two seperate queries based on seperate indices, will be a performance hit that severely limits the usefullness of Tamino’s document composition feature.