One way would be to keep an expanded version of the document in a different 
URI.  Then direct search at a different directory structure that only has fully 
expanded documents.    You can use  xinc:node-expand($node) to generate it.

This does double your data size in your database, but all of your search/facets 
are simplified.    This will return the expanded consolidated.xml.   If you 
need to only return the smaller version (with the x-includes), you either store 
a pointer in the expanded back the original or infer that based on some ID or 
something you have to reference the original document.

You could then use CPF to keep the expanded in sync when the base versions are 
updated.

Brad Rix | Technical Lead
O: +1 303 542 2172 | M: +1 303 915 2771
Skype: Brad.Rix | Google Talk: [email protected]

From: [email protected] 
[mailto:[email protected]] On Behalf Of Roy Chowdhury, 
Soumadri
Sent: Monday, May 25, 2015 6:35 AM
To: [email protected]
Subject: [MarkLogic Dev General] Search on XInclude documents


Hi,



I need to keep separate XML documents which belong to a single entity. But the 
search queries need to treat all these modules of XMLs as a single document to 
resolve the queries. E.g. Consider the following module xmls,



module1.xml

-----------------

<record>

    <fname>Foo</fname>

</record>



module2.xml

-----------------

<record>

    <lname>Bar</lname>

</record>



..and there's a main document which consolidates them



consolidated.xml

----------------------

<record>

    <xi:include href="module1.xml"/>

    <xi:include href="module2.xml"/>

</record>



and I use a query (with all the constraints defined),

        search:search("fname:Foo AND lname:Bar")



It should return "consolidated.xml" as a result.



Is there a way to search in an expanded XInclude document like the above 
example in Marklogic?



Regards,

Soumadri Roy




"This e-mail and any attachments transmitted with it are for the sole use of 
the intended recipient(s) and may contain confidential , proprietary or 
privileged information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. Any 
unauthorized review, use, disclosure, dissemination, forwarding, printing or 
copying of this e-mail or any action taken in reliance on this e-mail is 
strictly prohibited and may be unlawful."
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to