微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

带有 json 文档的查询字符串 MarkLogic 10 中的 BOOST 查询

如何解决带有 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 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?