Below Query is getting executed properly in Marklogic version 5.0.3 but
failing with exception in 6.0.2

import module namespace search = "http://marklogic.com/appservices/search";
    at "/MarkLogic/appservices/search/search.xqy";

fn:data(<search:custom-constraint-query><search:constraint-name>test</search:constraint-name><search:text>Language</search:text></search:custom-constraint-query>)

Please clarify the issue with ML 6 search.xqy.

Thanks,
Rajesh

On Mon, Jan 28, 2013 at 4:02 PM, Rajesh Kumar <[email protected]> wrote:

> Hi,
>
>
>   As part of our requirement, we need to pass a value using Search REST
> API in Marklogic 6. We are trying to use structuredQuery endpoint to
> achieve this. Please find the sample below:
>
> http://localhost:8006/v1/search?structuredQuery={"query": {"queries":
> {"custom-constraint-query": {"constraint-name": "test","text": ["*Language
> *"]}}}}&options=search
>
> *options node:*
>
> <search:options>
> <search:constraint name="test">
>     <search:custom facet="false">
>       <search:parse apply="construct-query" 
> ns="my-namespace<http://hmhpub.com/orgID>"
> at="/abc.xqy"/>
>     </search:custom>
>   </search:constraint>
> </search:options>
>
> *abc.xqy:*
>
>  declare function construct-query(
> $constraint-qtext as xs:string,
> $right as schema-element(cts:query))
> as schema-element(cts:query)
> {
>
> <root>{cts:element-value-query(xs:QName("title"),$right//cts:text/text())}</root>/*
>
>
> *Exception:*
>
> < rapi:error><rapi:status-code>500</rapi:status-code><rapi:status>INTERNAL
> ERROR</rapi:status><rapi:message-code>XDMP-NONMIXEDCOMPLEXCONT</rapi:message-code><rapi:message>XDMP-NONMIXEDCOMPLEXCONT:
> fn:data(<custom-constraint-query xmlns="
> http://marklogic.com/appservices/search";><constraint-name>test</constraint-name><text>Language</tex...</custom-constraint-query>)
> -- Node has complex type with non-mixed complex content.  See the MarkLogic
> server error log for further detail.</rapi:message></rapi:error>
> } ;
>
>
> Thanks,
> Rajesh
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to