Hi,
I have query regarding the suggestions.
I need to get suggestions from element <a> but have to return <a> along with
<b> element values.
What needs to be added to achieve it in below code.
Code:
xquery version "1.0-ml";
let $query := "year"
let $dummy := xdmp:log (("In main"),"info")
let $options :=
<options xmlns="http://marklogic.com/appservices/search">
<constraint name="test">
<range collation="http://marklogic.com/collation/"
type="xs:string" facet="false">
<element ns="" name="a"/>
</range>
</constraint>
<suggestion-source ref="test" >
<range collation="http://marklogic.com/collation/"
type="xs:string" facet="false">
<element ns="" name="a"/>
</range>
</suggestion-source>
</options>
let $finalquery := fn:concat("test:", $query)
let $suggestions := search:suggest($finalquery, $options)
return
$suggestions
Sample data:
- < <id="123">
< <a>......</a>
< <b>.......</b>
</id>
<id="234">
< <a>........</a>
< <b>.........</b>
</id>
Also my dataset is very large so need to see the performance also
Thanks
Pragya
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general