Hi David, It would be easier to comment if you could provide a working sample.
Some suggestions from the top of my head: You can pass doc() or collection() (note the empty arguments) as first argument to cts:search, these represent all documents in the whole database. As far as the first argument is meant as a filtering criterium, you can most often rewrite that into cts:query constructs that match at least pretty closely, though not always exactly. The returned nodes will be different this way though. Using doc() as first argument instead of for instance //name means that cts:search will return document nodes instead of name elements, and filters will have document scope, they will not be limited to the the nodes (and descendants) selected by the xpath. On the other hand, you are talking about cts:remainder. If you want to calculate the total remainder of two individual cts:searches, why can't you just call cts:remainder twice and add the two numbers? It would require that the intersect of the search results to be empty, but as you are talking about queries on documents with totally different structures, this doesn't sound likely to me.. Kind regards, Geert > Drs. G.P.H. Josten Consultant http://www.daidalos.nl/ Daidalos BV Source of Innovation Hoekeindsehof 1-4 2665 JZ Bleiswijk Tel.: +31 (0) 10 850 1200 Fax: +31 (0) 10 850 1199 http://www.daidalos.nl/ KvK 27164984 De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend. > From: [email protected] > [mailto:[email protected]] On Behalf Of > Lee, David > Sent: dinsdag 22 december 2009 13:33 > To: [email protected] > Subject: [MarkLogic Dev General] Combining Results > > Is there a way to combine results from different cts:search() > calls into one result set so that > > cts:remainder() works ? > > > > If I just put them into a combined sequence > ($res1,$res2,$res3) then cts:remainder() is very sensitive to which > > node I happen to pick. > > > > > > I guess a similar question would be is there a way to very > different combine cts:search() into 1 cts:search(). > > I know I can use a cts:or-query() but they still require a > consistant first argument to cts:search(). > > If I'm searching across a variety of document types with > totally different structure I havent figured out how > > to make a combined cts;search(). Can I put ALL the > criteria into the cts:query and pass "/" to the first argument ? > > I tried putting () in the first arg but of course that doesnt work :) > > > > > > > > > > > > > > ---------------------------------------- > > David A. Lee > > Senior Principal Software Engineer > > Epocrates, Inc. > > [email protected] <mailto:[email protected]> > > 812-482-5224 > > > > > > _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
