gpt4 book ai didi

搜索:搜索选项从 MarkLogic 7 迁移到版本 8

转载 作者:行者123 更新时间:2023-12-04 17:03:05 25 4
gpt4 key购买 nike

我正在尝试将用 XQuery 编写的搜索应用程序从 MarkLogic 7 迁移到版本 8,并且我遇到了有关选项中约束命名空间的已知不兼容问题。我尝试添加默认的 json/basic 命名空间,然后添加自定义命名空间,但没有奏效。当我在查询控制台网页中运行以下代码时,连接断开并在几秒钟后重新加载。我什至重新创建了一个元素范围索引,在我安装 ML 8 后,我所有的数据库都被识别出来,我重新索引了目标数据库。不知道还有什么问题。任何指导将不胜感激,谢谢!

xquery version "1.0-ml";

import module namespace search = "http://marklogic.com/appservices/search" at "/MarkLogic/appservices/search/search.xqy";

declare variable $options :=
<search:options xmlns:search="http://marklogic.com/appservices/search">
<search:search-option>unfiltered</search:search-option>
<search:page-length>30</search:page-length>
<search:term apply="term">
<search:empty apply="all-results"/>
<search:term-option>punctuation-insensitive</search:term-option>
<search:term-option>stemmed</search:term-option>
</search:term>
<search:grammar>
<search:quotation>"</search:quotation>
<search:implicit>
<cts:and-query strength="20" xmlns:cts="http://marklogic.com/cts"/>
</search:implicit>
<search:starter strength="30" apply="grouping" delimiter=")">(</search:starter>
<search:starter strength="40" apply="prefix" element="cts:not-query">-</search:starter>
<search:joiner strength="10" apply="infix" element="cts:or-query" tokenize="word">OR</search:joiner>
<search:joiner strength="20" apply="infix" element="cts:and-query" tokenize="word">AND</search:joiner>
<search:joiner strength="30" apply="infix" element="cts:near-query" tokenize="word">NEAR</search:joiner>
<search:joiner strength="30" apply="near2" consume="2" element="cts:near-query">NEAR/</search:joiner>
<search:joiner strength="50" apply="constraint">:</search:joiner>
<search:joiner strength="50" apply="constraint" compare="LT" tokenize="word">LT</search:joiner>
<search:joiner strength="50" apply="constraint" compare="LE" tokenize="word">LE</search:joiner>
<search:joiner strength="50" apply="constraint" compare="GT" tokenize="word">GT</search:joiner>
<search:joiner strength="50" apply="constraint" compare="GE" tokenize="word">GE</search:joiner>
<search:joiner strength="50" apply="constraint" compare="NE" tokenize="word">NE</search:joiner>
</search:grammar>
<search:additional-query>
<cts:not-query xmlns:cts="http://marklogic.com/cts">
<cts:or-query>
<cts:collection-query>
<cts:uri>ontology</cts:uri>
<cts:uri>Gemeentes</cts:uri>
<cts:uri>Wijken</cts:uri>
<cts:uri>Buurten</cts:uri>
<cts:uri>Wijk_Hierarchy</cts:uri>
<cts:uri>Buurt_Hierarchy</cts:uri>
<cts:uri>Kerncijfers_wijken_en_buurten_2014</cts:uri>
</cts:collection-query>
<cts:element-query>
<cts:element xmlns:sem="http://marklogic.com/semantics">sem:triples</cts:element>
<cts:or-query/>
</cts:element-query>
</cts:or-query>
</cts:not-query>
</search:additional-query>
<search:debug>false</search:debug>
<search:extract-metadata>
<search:qname elem-name="Vhe"/>
<search:qname elem-name="OpnameType"/>
<search:qname elem-name="Plaats"/>
<search:qname elem-name="Straat"/>
<search:constraint-value ref="Plaats"/>
<search:constraint-value ref="Straat"/>
<search:constraint-value ref="Keuken_Beoordeling"/>
<search:constraint-value ref="Badkamer_Beoordeling"/>
<search:constraint-value ref="location"/>
</search:extract-metadata>

<search:transform-results apply="snippet"/>

<search:constraint name="location">
<search:geo-elem-pair>
<search:parent name="location"/>
<search:lat name="lat"/>
<search:lon name="lng"/>
<search:geo-option>units=miles</search:geo-option>
<search:geo-option>coordinate-system=wgs84</search:geo-option>
<search:heatmap n="50.0006240" s="52.384274889550028" w="5.1864790" e="6.8864790" latdivs="14" londivs="19"/>
</search:geo-elem-pair>
</search:constraint>

<search:constraint name="Plaats">
<search:range type="xs:string" collation="http://marklogic.com/collation/">
<search:element name="Plaats"/>
</search:range>
</search:constraint>
<search:constraint name="Straat">
<search:range type="xs:string" collation="http://marklogic.com/collation/">
<search:element name="Straat"/>
</search:range>
</search:constraint>
<search:constraint name="Complex">
<search:range type="xs:string" collation="http://marklogic.com/collation/">
<search:element name="Complex"/>
</search:range>
</search:constraint>
<search:constraint name="Keuken_Beoordeling">
<search:range type="xs:string" collation="http://marklogic.com/collation/">
<search:element name="Keuken_Beoordeling"/>
</search:range>
</search:constraint>
<search:constraint name="Badkamer_Beoordeling">
<search:range type="xs:string" collation="http://marklogic.com/collation/">
<search:element name="Badkamer_Beoordeling"/>
</search:range>
</search:constraint>
<search:return-metrics>true</search:return-metrics>
<search:return-qtext>true</search:return-qtext>
<search:return-query>false</search:return-query>
<search:return-results>true</search:return-results>
<search:return-similar>false</search:return-similar>
<search:sort-order direction="descending">
<search:score/>
<search:annotation>Relevancy (Desc)</search:annotation>
</search:sort-order>
</search:options>;

search:search("wieer", $options, xs:unsignedLong(1), 150)

最佳答案

正如 Joe 指出的那样,服务器可能会崩溃并自动重新启动。查询 ErrorLog.txt来验证这一点。确保您拥有 very latest release : 现在是 8.0-1.1。

测试用例做 不是 使用 8.0-1.1 和必要的索引设置在我的笔记本电脑上崩溃。但是我没有任何匹配的文件,所以它的作用不大。这可能意味着崩溃(如果确实如此)也需要您的一些内容。您可以尝试使用空数据库来验证这一点,然后尝试确定问题是否与特定的文档集有关。

如果问题仍然存在,contact support报告它。

关于搜索:搜索选项从 MarkLogic 7 迁移到版本 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29101183/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com