In my search:suggest call I specify a word prefix constraint on a element. For some reason I am not getting suggestions for that prefix constraint search:
This code illustrates my problem:
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>
)
This does not result in any suggestions. Only after adding the following suggestions-source, I get the expected suggestions:
<suggestion-source ref="title">
<word collation="http://marklogic.com/collation/en">
<element name="title"/>
</word>
</suggestion-source>
This does not seem to be the same with range or collection constraints, suggestions work out of the box and without a suggestion-source.
Is there a reason why suggestions are not shown for word constraints, e.g. performance? Is this behaviour documented somewhere?
Using MarkLogic 9.0-8.