(Using ML 7.0-4.1) I added an extension to my Search API options to transform
terms into field-word-queries:
declare function my:search-term(
$ps as map:map,
$term as element()?)
as schema-element(cts:query)
{
document {
cts:field-word-query(
'my-field',
sdev:current($ps),
$term/search:term-option[
not(starts-with(., "lang="))]/element cts:option { string() }) }/*
,
sdev:advance($ps)
};
Parsing works exactly as expected, however unparse() throws an exception:
"SEARCH-NONANNOTATED: (err:FOER0000) Non-annotated query"
let $parsed :=
search:parse("test",
<options xmlns="http://marklogic.com/appservices/search">
<term apply="search-term" ns="http://myns" at="/mymodule.xqm">
<empty apply="no-results" />
</term>
</options>)
return search:unparse($parsed)
I poked around search-impl.xqy and tried to create my own <cts:annotation>, but
I have not been successful. I suspect there is some nuance I'm missing. Any
suggestions? Is this possible? It seems like it should be.
Thanks,
Will
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general