*Hi Team,*

In Google, when we start typing a word, an auto drop down list is displayed
with suggested list and frequency of word occurrence. Similarly we are
planning to implement in our application.



Is there any way to achieve using cts:frequency?



Since cts:frequency use value lexicon APIs (i.e. cts:element-values,
cts:element-attribute-values); we need to created a range index against any
node element which allow us to suggest a list and the frequency based on the
value of the node but not based on words in that node.





Following is code snippet which gives us suggested value and the frequency
of the value by not suggested word in that node. Can anyone help us to get
the frequency of a word for the suggested list?



declare namespace e="http://www.simonandschuster.com/namespaces/sands_pub";;

let $searchword:= "All"

let $suggestResult :=
cts:element-word-match(fn:QName("
http://www.simonandschuster.com/namespaces/sands_pub","title";),concat($searchword<http://www.simonandschuster.com/namespaces/sands_pub%22,%22title%22),concat($searchword>,"*")
,("case-insensitive","ascending","limit=10"))
for $a in $suggestResult
let $b := cts:element-values(xs:QName("e:title"),$a,("item-frequency"))[1]

return <result>{($a,fn:concat("---------
",cts:frequency($b)))}</result>



Thanks in Advance.



Thanks & Regards,

Selven Xavier .A
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to