我有以下XML結構:Marklogic:搜索:建議在短語
<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)
結果我得到了「測試」和「tseting」的建議,絕對是不錯,但我太想一些文字像在上述情況下,我期待「測試用戶,做.. 。「和」在這裏測試......「。請幫助我。