У меня есть этот кусок кода
declare variable $a as xs:string := "case-insensitive punctuation-insensitive
unwildcarded";
declare variable $b as xs:string* := tokenize($a, ' ');
let $d as cts:query := cts:field-word-query("FULL-CASE-NAME", "complaints",
$b, 30)
return <q>{$d}</q>
, который производит это
<q>
<cts:field-word-query weight="30" xmlns:cts="http://marklogic.com/cts">
<cts:field>FULL-CASE-NAME</cts:field>
<cts:text xml:lang="en">complaints</cts:text>
<cts:option>case-insensitive</cts:option>
<cts:option>punctuation-insensitive</cts:option>
<cts:option>unwildcarded</cts:option>
</cts:field-word-query>
</q>
, но я хочу получить это
<q>
<cts:field-word-query weight="30" xmlns:cts="http://marklogic.com/cts">
<cts:field weight="10">FULL-CASE-NAME</cts:field>
<cts:text xml:lang="en">complaints</cts:text>
<cts:option>case-insensitive</cts:option>
<cts:option>punctuation-insensitive</cts:option>
<cts:option>unwildcarded</cts:option>
</cts:field-word-query>
</q>
разницав этой строке добавлен вес в качестве атрибута
<cts:field weight="10">FULL-CASE-NAME</cts:field>