I have a use case where there is a parent document and some child documents to the parent document. When I search I want to always return the parent documents. let us say if a search result hit 2 child documents with same parent, then the results need to be grouped to one search result with snippets carried over from child docs. Also I want to apply paging, but pagination should be on the transformed search results. Is this possible? The relation between parent and child is the property <parent-document-location>
on the 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>
Child 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>
Child 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>