Hi, Gnana and Gary: Thanks, Gary, for identifying the issue.
What's happening, Gnana, is that the <search:additional-query> element must contain the serialization of a cts:query and not an inline XQuery expression with constructor calls for the cts:query. The expression works in QueryConsole because the code buffer is evaluated. So, the expression is executed, creating cts:query objects, which are then serialized as the content of the <search:additional-query> element before it is passed to the Search API. The payload sent to the REST API, however, is not evaluated (nor should it be for security reasons). So, the cts:query objects must already be serialized in the payload. Hoping that clarifies, Erik Hennum ________________________________ From: [email protected] [[email protected]] on behalf of [email protected] [[email protected]] Sent: Thursday, April 23, 2015 8:01 AM To: [email protected] Subject: Re: [MarkLogic Dev General] Additional Query in Rest Thanks Gary That worked for me. Working: <search:additional-query> <cts:element-query> <cts:element>hmhGuid</cts:element> <cts:and-query/> </cts:element-query> </search:additional-query> Not Working: <search:additional-query>{cts:element-query(xs:QName("hmhGuid"), cts:and-query(()))}</search:additional-query> I understood that internally ML is converting into the above working one but any ways my issue is resolved and it’s a learning for me :) Regards, Gnana(GP) 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 [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
