我有以下 xml 结构:
<root>
<text>Hi i am a test user and doing testing here. Copied text Let’s suppose we have a text field where the user needs to enter the number of a person id. If the user types 1, all ids starting with 1 will show up. If the user types 12, all ids starting with 12 will show up.</text>
</root>
现在我在“文本”元素上创建了字段,并在其上启用了字段词词典。执行以下查询:
xquery version "1.0-ml";
import module namespace search ="http://marklogic.com/appservices/search" at "/MarkLogic/appservices/search/search.xqy";
let $options :=
<search:options xmlns="http://marklogic.com/appservices/search">
<default-suggestion-source>
<word collation="http://marklogic.com/collation//S2">
<field name="text"/>
</word>
</default-suggestion-source>
</search:options>
return
search:suggest("tes", $options, 100)
结果,我得到了“test”和“tseting”作为建议,这绝对没问题,但我也想要更多的文本,就像上面的情况一样,我期待“测试用户和做……”和“在这里测试……”。请帮助我。