Hi, Probably, you are looking for <return-results>false</return-results> option to yield facets ONLY.
But it seems you are comparing facets value with XML file and re-creating a new XML based on your business logic. I think there will be some performance impact in comparison. Could you please describe more about your requirement, specially in iteration part? Cheers, Mihir > Message: 2 > Date: Mon, 13 May 2013 16:50:06 +0000 > From: "Singh, Gurbeer" <[email protected]> > Subject: [MarkLogic Dev General] Building Facet UI > To: "[email protected]" > <[email protected]> > Message-ID: > <[email protected]> > Content-Type: text/plain; charset="us-ascii" > > Hi > > Need some suggestion to build UI from Facet > > I want to restructure my Facet UI code, just want to make sure I am taking > right approach > > Search:search will give result + facet result > > I have a XML which contains all meta data of facet. XML file name is > Taxonomy > > This algorithm I am planning to follow > > > let $result:=search:search('policy', $config:OPTIONS, > 1)/search:facet/search:facet-value > > for $taxonomyItem in > fn:doc($TAX_DOC)/taxonomy/taxonomyItem > <div><B> $taxonomyItem/@name </B> > <UL> > > for $level1 in $taxonomyItem/level1 > > if($result/@name eq $level1/@name) then (: compare > result facet value text and XML file value TEXT:) > > <LI> $level1/@name {xdmp:quote($result[@name eq > $level1/@name]/@count)} (:Showing Facet value and count:) > > if (fn:exists($level1/level2)) then > <UL> > > for $level2 in > $level1/level2 > > > if($result/@name eq $level2/@name) then > > > <LI>$level2/@name {xdmp:quote($result[@name eq $level2/@name]/@count)} > </LI> els() > </UL> else() > </LI> > </UL> > </DIV> > > > ________________________________ > > NOTICE: Morgan Stanley is not acting as a municipal advisor and the > opinions or views contained herein are not intended to be, and do not > constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall > Street Reform and Consumer Protection Act. If you have received this > communication in error, please destroy all electronic and paper copies and > notify the sender immediately. Mistransmission is not intended to waive > confidentiality or privilege. Morgan Stanley reserves the right, to the > extent permitted under applicable law, to monitor electronic > communications. This message is subject to terms available at the following > link: http://www.morganstanley.com/disclaimers If you cannot access these > links, please notify us by reply message and we will send the contents to > you. By messaging with Morgan Stanley you consent to the foregoing. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > http://developer.marklogic.com/pipermail/general/attachments/20130513/3d04dc3f/attachment.html > > ------------------------------ > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > > > End of General Digest, Vol 107, Issue 28 > **************************************** >
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
