Hi,

I have to find the score for each result of cts:search like:

declare variable $OPTIONS as xs:string* := ('case-insensitive','limit=1000');
let $term := 'Fuji'
let $values := cts:value-match(cts:path-reference('/books/book/title), 
fn:concat("*",$term,"*"),$OPTIONS)
let $tempQuery         := for $value in ($values)
                                              return
                                             
cts:path-range-query('/books/book/title’,'=',$value)
let $query   := cts:or-query(($tempQuery))

for $hit in cts:search(/books/book/title, 
$query,('unfiltered',"score-simple"),1.0)             [1 to 10]
return element hit {
  attribute score { cts:score($hit) },
  $hit
}


But  I am getting the score as 0 always because If you run cts:score on a 
constructed node, it always returns 0; it is primarily intended to run on nodes 
that are retrieved from the database (an item from a cts:search result or an 
item from the result of an XPath expression that searches through the database).
How can I modify my xpath or query to return cts:score.

Thanks
Pragya

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not 
to copy, disclose, or distribute this e-mail or its contents to any other 
person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken 
every reasonable precaution to minimize this risk, but is not liable for any 
damage 
you may sustain as a result of any virus in this e-mail. You should carry out 
your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this 
e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to