Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created September 22, 2016 15:54
Show Gist options
  • Save ableasdale/29d8ca5b2519daf27423886e95779a0d to your computer and use it in GitHub Desktop.
Save ableasdale/29d8ca5b2519daf27423886e95779a0d to your computer and use it in GitHub Desktop.
Relevance Trace Computation Example
<qry:relevance-info xmlns:qry="http://marklogic.com/cts/query">
<qry:score formula="(256*scoreSum/weightSum)+(256*qualityWeight*documentQuality)" computation="(256*12/1)+(256*1*0)">3072</qry:score>
<qry:confidence formula="sqrt(score/(256*8*maxlogtf*maxidf))" computation="sqrt(3072/(256*8*18*log(5)))">0.2275476</qry:confidence>
<qry:fitness formula="sqrt(score/(256*8*maxlogtf*avgidf))" computation="sqrt(3072/(256*8*18*(0/1)))">0.2886751</qry:fitness>
<qry:uri>/doc2.xml</qry:uri>
<qry:path>fn:doc("/doc2.xml")</qry:path>
<qry:term weight="0.125">
<qry:score formula="8*weight*logtf" computation="1*12">12</qry:score>
<qry:key>8828337839282077581</qry:key>
<qry:annotation>word("fun")</qry:annotation>
</qry:term>
</qry:relevance-info>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment