@Ryan - you are right cts:search is also giving the same results when "unfiltered"
Is there an option to make cts:uris/ cts:uri-match behave like a filtered search?? On Tue, Feb 12, 2013 at 6:31 PM, Ryan Dew <[email protected]> wrote: > I believe this is because cts:uris is always unfiltered. You should get > the same result from cts:search result if you passed the 'unfiltered' > option. I believe you can get what you want if you set 'detail' as a > fragment root. You can read about fragment roots here: > http://docs.marklogic.com/guide/admin/fragments#id_34807 > > I maybe wrong since I've never tested this sort of thing with cts:uris, > but someone smarter than me might be able to have a more certain answer. > > -Ryan Dew > > > On Tue, Feb 12, 2013 at 4:20 PM, Raghu > <[email protected]>wrote: > >> HI all, >> >> >> I have a parent - detail >> with two children -name , value >> I wrote an xquery to fetch the document with both name and value (should >> be siblings) with 'a' as value >> cts:search is working a s expected whereas cts:uris isn't >> Please find below the sample xquery >> Thanks in advance >> >> >> xdmp:document-insert("/1.xml", >> >> <root> >> >> <detail> >> >> <name>a</name> >> >> <value>a</value> >> >> </detail> >> >> <detail> >> >> <name>a</name> >> >> <value>b</value> >> >> </detail> >> >> </root> >> >> ), >> >> xdmp:document-insert("/2.xml", >> >> <root> >> >> <detail> >> >> <name>a</name> >> >> <value>b</value> >> >> </detail> >> >> <detail> >> >> <name>b</name> >> >> <value>a</value> >> >> </detail> >> >> </root> >> >> ), >> >> xdmp:document-insert("/3.xml", >> >> <root> >> >> <detail> >> >> <name>b</name> >> >> <value>b</value> >> >> </detail> >> >> <detail> >> >> <name>b</name> >> >> <value>b</value> >> >> </detail> >> >> </root> >> >> ); >> >> (: both children of detail ‘name’ and ‘value’ should have ‘a’ as text >> content :) >> >> >> let $myquery := cts:element-query(xs:QName("detail"), >> >> >> cts:and-query(( >> >> >> >> cts:element-range-query(xs:QName("name"),"=","a"), >> >> >> >> cts:element-range-query(xs:QName("value"),"=","a") >> >> >> )) >> >> >> ) >> >> >> return >> >> >> ( >> >> >> "cts:uris/ cts:uri-match results:", >> >> >> cts:uris('',(),$myquery), >> >> >> "cts:search results:", >> >> >> cts:search(/root,$myquery) >> >> >> ) >> >> >> _______________________________________________ >> General mailing list >> [email protected] >> http://developer.marklogic.com/mailman/listinfo/general >> >> > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > >
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
