Hi all,

I have thousands of document in my DB in the below mentioned format.
These are related as parent and children using the parentid. I have
element range index configured for all the elements.

Parent document:
<root>
<id>12345</id>
<parentid>12345</parentid>
<name></name>
<date>2012-01-01</date>
<title>orange</title>
</root>

Child document 1:
<root>
<parentid>12345</parentid>
<id>9876</id>
<name></name>
<date>2012-02-25</date>
<title>apple</title>
</root>

Child document 2:
<root>
<parentid>12345</parentid>
<id>4876</id>
<name></name>
<date>2012-02-25</date>
<title>apple</title>
</root>

I am using search:search to filter documents. I have the below logic:
I filter the records with a particular date range,retrieve the unique
parentids from search:facet. Later using a CTS search, I retrieve the
child documents.
Is there any other way to retrieve the child documents without doing a
second search.

Also, I have another requirement to get unique results like the below,
i.e For 2012-02-25 the title value is apple….
    For 2012-01-01 the title value is orange.
Within a particular set of parent and children documents, for the
applied range date filter the count of matching unique title values
and it's corresponding date value is required. Currently, I am using
Xpath to retrieve the title values when the date is applied as a
range- date1..date2. This is becoming a performance hit when loads of
documents are retrieved and processed in such a way. Is there a
optimized way without the usage of xpath and with facets/customized
constraints etc.,?

Thanks
Radhika.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to