当我在引导查询中使用约束时,boost就被忽略了。以下是我的选项文件
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一起工作?
*更新搜索计划*
<search:plan>
<qry:query-plan xmlns:qry="http://marklogic.com/cts/query">
<qry:expr-trace>impl:apply-search(map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" .../>), "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>发布于 2022-07-13 16:28:28
如果有人是interested..once,我把得分改为score-simple,它起了作用。将以下内容添加到我的search-options中
<search-option>score-simple</search-option>默认情况下,它是在执行logft,这会导致问题。
<search-option>relevance-trace</search-option>这个选项会告诉你分数是如何计算的
https://stackoverflow.com/questions/72955062
复制相似问题