如何解决带有 json 文档的查询字符串 MarkLogic 10 中的 BOOST 查询
"((title:Flexon OR subjectheading:English) AND (abstract:spring OR abstract:post))"
let $options := <options xmlns="http://marklogic.com/appservices/search">
<debug>true</debug>
<concurrency-level>8</concurrency-level>
<search-option>unfiltered</search-option>
<search:transform-results apply="empty-snippet"><!-- @apply=snippet : to get snippet-->
<search:per-match-tokens>30</search:per-match-tokens>
<search:max-matches>4</search:max-matches>
<search:max-snippet-chars>200</search:max-snippet-chars>
<search:preferred-matches></search:preferred-matches>
</search:transform-results>
<term>
<term-option>case-insensitive</term-option>
<term-option>wildcarded</term-option>
<term-option>stemmed</term-option>
<term-option>diacritic-insensitive</term-option>
<term-option>punctuation-insensitive</term-option>
</term>
<constraint name="title">
<word>
<json-property>Title</json-property>
<term>
<term-option>case-insensitive</term-option>
<term-option>wildcarded</term-option>
<term-option>stemmed</term-option>
<term-option>diacritic-insensitive</term-option>
<term-option>punctuation-insensitive</term-option>
</term>
</word>
</constraint>
<constraint name="abstract">
<word>
<json-property>Abstract</json-property>
<term>
<term-option>case-insensitive</term-option>
<term-option>wildcarded</term-option>
<term-option>stemmed</term-option>
<term-option>diacritic-insensitive</term-option>
<term-option>punctuation-insensitive</term-option>
</term>
</word>
</constraint>
<constraint name="pubDate">
<range type="xs:date" facet="false">
<path-index>text('Date of Publication')</path-index>
</range>
</constraint>
<constraint name="subjectheading">
<word>
<json-property>Subject headings</json-property>
<term>
<term-option>case-insensitive</term-option>
<term-option>wildcarded</term-option>
<term-option>stemmed</term-option>
<term-option>diacritic-insensitive</term-option>
<term-option>punctuation-insensitive</term-option>
</term>
</word>
</constraint>
</options>
现在,如果我想以不同的权重提升对标题和摘要的查询,我该如何实现? 喜欢标题权重 30 和摘要权重 10
所以目前正在构建的查询是
(cts:search(fn:collection(),cts:and-query((cts:or-query((cts:json-property-word-query(\"Title\",\"Flexon\",(\"lang=en\"),1),cts:json-property-word-query(\"Subject headings\",\"English\",1)),()),cts:or-query((cts:json-property-word-query(\"Abstract\",\"spring\",cts:json-property-word-query(\"Abstract\",\"post\",())),(\"unfiltered\",cts:score-order(\"descending\")),1))[1 to 10]
而我们希望这样构建查询
(cts:search(fn:collection(),30),10),10)),1))[1 to 10]
我必须对查询字符串或选项进行哪些更改才能实现?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。