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