Hi there, The reason that this doesn't work in REST verbatim is that the XQuery interpreter turns {cts:element-query...} into an XML serialization of the query, whereas REST cannot do that.
What you need is to look at the output of <search:additional-query>{cts:element-query(xs:QName("hmhGuid"), cts:and-query(()))}</search:additional-query> in QConsole (NOT the search) and use what you see there in your REST options. It will look like this. <search:additional-query xmlns:search="http://marklogic.com/appservices/search"> <cts:element-query xmlns:cts="http://marklogic.com/cts"> <cts:element>hmhGuid</cts:element> <cts:and-query/> </cts:element-query> </search:additional-query> Charles ________________________________ From: general-boun...@developer.marklogic.com [general-boun...@developer.marklogic.com] on behalf of gnanaprakash.bodire...@cognizant.com [gnanaprakash.bodire...@cognizant.com] Sent: Thursday, April 23, 2015 6:02 AM To: general@developer.marklogic.com Subject: [MarkLogic Dev General] Additional Query in Rest Hi I am facing an issue with additional-query in REST Search options. I am having search options as below. I am expecting the results only with element hmhGuid. <search:options xmlns:search="http://marklogic.com/appservices/search"> <search:quality-weight>0</search:quality-weight> <search:search-option>unfiltered</search:search-option> <search:additional-query>{cts:element-query(xs:QName("hmhGuid"), cts:and-query(()))}</search:additional-query> …. Search options are returning results as expected in QC but not through REST services. Additional query won’t work in REST? Regards, Gnanaprakash Bodireddy Sr. Associate – Projects, Dublin Ireland Mob: +353 87 964 9549 Desk: +353 1 650 0369 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. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.
_______________________________________________ General mailing list General@developer.marklogic.com Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general