首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >搜索选项中的BOOST查询

搜索选项中的BOOST查询
EN

Stack Overflow用户
提问于 2022-07-12 15:48:24
回答 1查看 26关注 0票数 1

当我在引导查询中使用约束时,boost就被忽略了。以下是我的选项文件

代码语言:javascript
复制
let $options := 
<options xmlns="http://marklogic.com/appservices/search">
  <constraint name="gs">
    <value>
      <element ns="http://xxxx/entity/target" name="gene-symbol"/>
    </value>
  </constraint>
  <constraint name="taxid">
    <value>
      <element ns="http://xxx/entity/target/species" name="taxonomy-id"/>
    </value>
  </constraint>
  <constraint name="search-text">
    <custom facet="false">
      <parse apply="parse-string"
             ns="http://xxx/xxx/custom-constraints/dads/dadsAutosuggestConstraint"
             at="/lib/custom-constraints/dads/dadsAutosuggestConstraint.xqy"/>
    </custom>
  </constraint>
  <term>
    <default ref="search-text" />
    <term-option>case-insensitive</term-option>
    <term-option>punctuation-insensitive</term-option>
    <term-option>whitespace-insensitive</term-option>
    <term-option>wildcarded</term-option>
  </term>
</options>

当我这么做

let $q := 'gs:PARP1 BOOST (taxid:9606)'

助推被忽略..。但是当没有约束的时候

let $q := 'PARP1 BOOST (taxid:9606)'

它像预期的那样工作..。

如何使它与constraints一起工作?

*更新搜索计划*

代码语言:javascript
复制
<search:plan>
    <qry:query-plan xmlns:qry="http://marklogic.com/cts/query">
      <qry:expr-trace>impl:apply-search(map:map(&lt;map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" .../&gt;), "xdmp:plan", fn:false())</qry:expr-trace>
      <qry:info-trace>Analyzing path for search: fn:collection()</qry:info-trace>
      <qry:info-trace>Step 1 is searchable: fn:collection()</qry:info-trace>
      <qry:info-trace>Path is fully searchable.</qry:info-trace>
      <qry:info-trace>Gathering constraints.</qry:info-trace>
      <qry:elem-word-trace text="PARP1" elem-name="gene-symbol" elem-uri="http://schemas.abbvienet.com/entity/target">
    <qry:key>4322900364588965241</qry:key>
      </qry:elem-word-trace>
      <qry:info-trace>Search query contributed 1 constraint: cts:boost-query(cts:element-word-query(fn:QName("http://schemas.abbvienet.com/entity/target","gene-symbol"), "PARP1", ("lang=en"), 1), cts:element-value-query(fn:QName("http://schemas.abbvienet.com/entity/target/species","taxonomy-id"), "9606", ("lang=en"), 1))</qry:info-trace>
      <qry:partial-plan>
    <qry:and-two-queries ordered="true">
      <qry:term-query weight="1">
        <qry:key>4322900364588965241</qry:key>
        <qry:annotation>element(http://schemas.abbvienet.com/entity/target:gene-symbol,word("PARP1"))</qry:annotation>
      </qry:term-query>
      <qry:or-two-queries>
        <qry:term-query weight="1">
          <qry:key>3406225445527486620</qry:key>
          <qry:annotation>element(taxonomy-id,value("9606"))</qry:annotation>
        </qry:term-query>
        <qry:and-query ordered="true"/>
      </qry:or-two-queries>
    </qry:and-two-queries>
      </qry:partial-plan>
      <qry:info-trace>Executing search.</qry:info-trace>
      <qry:ordering/>
      <qry:final-plan>
    <qry:and-query>
      <qry:and-two-queries ordered="true">
        <qry:term-query weight="1">
          <qry:key>4322900364588965241</qry:key>
          <qry:annotation>element(http://schemas.abbvienet.com/entity/target:gene-symbol,word("PARP1"))</qry:annotation>
        </qry:term-query>
        <qry:or-two-queries>
          <qry:term-query weight="1">
        <qry:key>3406225445527486620</qry:key>
        <qry:annotation>element(taxonomy-id,value("9606"))</qry:annotation>
          </qry:term-query>
          <qry:and-query ordered="true"/>
        </qry:or-two-queries>
      </qry:and-two-queries>
    </qry:and-query>
      </qry:final-plan>
      <qry:info-trace>Selected 6 fragments to filter</qry:info-trace>
      <qry:result estimate="6"/>
    </qry:query-plan>
  </search:plan>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-13 16:28:28

如果有人是interested..once,我把得分改为score-simple,它起了作用。将以下内容添加到我的search-options

代码语言:javascript
复制
<search-option>score-simple</search-option>

默认情况下,它是在执行logft,这会导致问题。

<search-option>relevance-trace</search-option>这个选项会告诉你分数是如何计算的

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72955062

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档