Use cts:uris along with cts:and-query.
Basically, you should search for (name=bookname and value=Shakespeare). If you 
just search (value=Shakespeare) in cts:uris, you will get both the documents.

Thanks and Regards,
Karthik

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Vedavalli Radhika
Sent: Wednesday, February 13, 2013 2:48 PM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] Somebody please help me!

Damon,
As mentioned by Raghu, below is the format of the xml stored in our database.
There can be multiple detail elements with name/value elements as children.
We have a requirement to achieve filtering based on the supplied name/value 
pair entries.
Say for the below xmls, if I filter as name:bookname and value:Shakespeare, I 
expect only the second xml to be returned back.
This works as expected when cts:search is used. But with cts:uris, both the 
xmls are returned back. When we performed a response time comparison between 
cts:search and cts:uris, cts:uris performs better.
This is when we started to look out for options to achieve the above 
functionality with cts:uris.  Can you advise on how we can achieve this with 
cts:uris or a better performing api than cts:search?

Sample 1:
<root>
  <detail>
  <name>bookname</name>
  <value>Hamlet</value>
  </detail>
  <detail>
  <name>author</name>
  <value>Shakespeare</value>
  </detail>
</root>

Sample 2:
<root>
  <detail>
  <name>bookname</name>
  <value>Shakespeare</value>
  </detail>
  <detail>
  <name>author</name>
  <value>Michael Wood</value>
  </detail>
</root>

Thanks,
Radhika.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to