Hi,
Please consider the below case:
Document 1:
<doc>
<item name="fruit" value="apple"/>
<item name="color" value="red"/>
<item name="car" value="alto"/>
<item name="currency" value="dollar"/>
</doc>
Document 2:
<doc>
<item name="vegetable" value="okra"/>
<item name="fruit" value="apple"/>
<item name="car" value="swift"/>
<item name="currency" value="dollar"/>
</doc>
Document 3:
<doc>
<item name="fruit" value="banana"/>
<item name="color" value="blue"/>
<item name="car" value="verna"/>
<item name="currency" value="rupee"/>
</doc>
Referring to the above example, two or more documents are said to be linked if
the item element with @name = currency and their @value matches. Thus, in the
above case, document 1 is linked to document 2 but not document 3.
In order to get the URIs of all the linked document, I think of using the
following approach:
Since attribute range indexes on both @name and @value are available, all the
matching @value for which @name = currency can be grouped together. Once all
the groups are obtained, I will return the URI of the documents from each
group. Using the URIs, I will add an element in each of the documents from a
group which will serve as a link between them.
However, I am not sure how I can form groups just by referring to range
indexes. Please help me construct the XQUERY to get the desired result.
Thanks and Regards,
Nachiketa
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are
not
to copy, disclose, or distribute this e-mail or its contents to any other
person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has
taken
every reasonable precaution to minimize this risk, but is not liable for any
damage
you may sustain as a result of any virus in this e-mail. You should carry out
your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this
e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general