没有单词限制的建议
no Suggestions for word constraints
在我的 search:suggest
调用中,我在元素上指定了 word 前缀约束。出于某种原因,我没有得到关于前缀约束搜索的建议:
这段代码说明了我的问题:
let $doc :=
<doc>
<title>Show me some suggestions!</title>
</doc>
return xdmp:document-insert('so.xml', $doc);
import module namespace search = "http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";
search:suggest('title:',
<options xmlns="http://marklogic.com/appservices/search">
<constraint name="title">
<word collation="http://marklogic.com/collation/en">
<element name="title" />
</word>
</constraint>
<default-suggestion-source>
<word-lexicon collation="http://marklogic.com/collation/en"/>
</default-suggestion-source>
</options>
)
这不会产生任何建议。仅在添加以下 suggestions-source
后,我得到了预期的建议:
<suggestion-source ref="title">
<word collation="http://marklogic.com/collation/en">
<element name="title"/>
</word>
</suggestion-source>
这似乎与 range
或 collection
约束不同,建议开箱即用,没有 suggestion-source
。
没有显示针对 word
约束的建议是否有原因,例如表现?这种行为是否记录在某处?
使用 MarkLogic 9.0-8。
如果您为特定 JSON 属性 或元素创建了一个词库,选项应该能够以这种方式引用约束:
<default-suggestion-source ref="title"/>
或以这种方式识别内联词词典:
<default-suggestion-source>
<word collation="http://marklogic.com/collation/en">
<element name="title" />
</word>
</default-suggestion-source>
单词词典查询选项指定数据库范围的单词词典。如果为数据库启用了数据库范围的词词典,word-lexicon 元素应该可以工作——尽管不推荐这样做(除非数据库非常小)。
有关详细信息,请参阅:
http://docs.marklogic.com/guide/search-dev/search-api#id_89118
http://docs.marklogic.com/guide/search-dev/appendixa#id_35361
希望对您有所帮助,
在我的 search:suggest
调用中,我在元素上指定了 word 前缀约束。出于某种原因,我没有得到关于前缀约束搜索的建议:
这段代码说明了我的问题:
let $doc :=
<doc>
<title>Show me some suggestions!</title>
</doc>
return xdmp:document-insert('so.xml', $doc);
import module namespace search = "http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";
search:suggest('title:',
<options xmlns="http://marklogic.com/appservices/search">
<constraint name="title">
<word collation="http://marklogic.com/collation/en">
<element name="title" />
</word>
</constraint>
<default-suggestion-source>
<word-lexicon collation="http://marklogic.com/collation/en"/>
</default-suggestion-source>
</options>
)
这不会产生任何建议。仅在添加以下 suggestions-source
后,我得到了预期的建议:
<suggestion-source ref="title">
<word collation="http://marklogic.com/collation/en">
<element name="title"/>
</word>
</suggestion-source>
这似乎与 range
或 collection
约束不同,建议开箱即用,没有 suggestion-source
。
没有显示针对 word
约束的建议是否有原因,例如表现?这种行为是否记录在某处?
使用 MarkLogic 9.0-8。
如果您为特定 JSON 属性 或元素创建了一个词库,选项应该能够以这种方式引用约束:
<default-suggestion-source ref="title"/>
或以这种方式识别内联词词典:
<default-suggestion-source>
<word collation="http://marklogic.com/collation/en">
<element name="title" />
</word>
</default-suggestion-source>
单词词典查询选项指定数据库范围的单词词典。如果为数据库启用了数据库范围的词词典,word-lexicon 元素应该可以工作——尽管不推荐这样做(除非数据库非常小)。
有关详细信息,请参阅:
http://docs.marklogic.com/guide/search-dev/search-api#id_89118
http://docs.marklogic.com/guide/search-dev/appendixa#id_35361
希望对您有所帮助,