I have a use case when there is a parent document and some child documents in the parent document. When I search, I want to always return parent documents. say, if the search result hit 2 child documents with the same parent, the results should be grouped into one search result with fragments transferred from the child documents. I also want to apply paging, but pagination should be on converted search results. Is it possible? The relationship between parent and child is a property <parent-document-location>for child documents.
Parent Document Properties
<?xml version="1.0" encoding="UTF-8"?>
<prop:properties xmlns:prop="http://marklogic.com/xdmp/property">
<id xmlns="http://ir.abbivenet.com/content-repo/metadata">1e900d1a7210350c0b68973fb0d6dc96f83e161a</id>
<cpf:processing-status xmlns:cpf="http://marklogic.com/cpf">done</cpf:processing-status>
<cpf:property-hash xmlns:cpf="http://marklogic.com/cpf">34d0a49cf8835387f6bd213a31732ad4</cpf:property-hash>
<cpf:last-updated xmlns:cpf="http://marklogic.com/cpf">2016-03-15T21:18:20.521372Z</cpf:last-updated>
<cpf:state xmlns:cpf="http://marklogic.com/cpf">http://marklogic.com/states/done</cpf:state>
<cpf:self xmlns:cpf="http://marklogic.com/cpf">/documents/BioEln/1e900d1a7210350c0b68973fb0d6dc96f83e161a.xml</cpf:self>
<prop:last-modified>2016-03-15T21:50:38Z</prop:last-modified>
</prop:properties>
Children's document 1
<?xml version="1.0" encoding="UTF-8"?>
<prop:properties xmlns:prop="http://marklogic.com/xdmp/property">
<document-parent-location xmlns="http://ir.abbivenet.com/content-repo/metadata">/documents/BioEln/1e900d1a7210350c0b68973fb0d6dc96f83e161a.xml</document-parent-location>
<context xmlns="http://ir.abbivenet.com/content-repo/metadata">BioEln</context>
<id xmlns="http://ir.abbivenet.com/content-repo/metadata">1e900d1a7210350c0b68973fb0d6dc96f83e161a</id>
<prop:last-modified>2016-03-15T21:50:34Z</prop:last-modified>
</prop:properties>
Children's document 2
<?xml version="1.0" encoding="UTF-8"?>
<prop:properties xmlns:prop="http://marklogic.com/xdmp/property">
<document-parent-location xmlns="http://ir.abbivenet.com/content-repo/metadata">/documents/BioEln/1e900d1a7210350c0b68973fb0d6dc96f83e161a.xml</document-parent-location>
<context xmlns="http://ir.abbivenet.com/content-repo/metadata">BioEln</context>
<id xmlns="http://ir.abbivenet.com/content-repo/metadata">1e900d1a7210350c0b68973fb0d6dc96f83e161a</id>
<prop:last-modified>2016-03-15T21:50:34Z</prop:last-modified>
</prop:properties>