Hello all,
I am trying to find out a way to assign weights to certain sections of the xml 
document using following rules:
If <title-csid> tag is present anywhere in the document title then assign that 
document a weight of 10.0If <section-csid> tag is present anywhere in the 
document then assign document a weight of 6.0If <body-csid> tag is present 
anywhere in the body then assign 0.0006 as the weight to the document.If 
atleast one <primaryChemistryAsset> tag is present then assign a weight of 8.0
So in the end a document containing only one <title-csid> element will weight 
more against a document containing 1 <section-id> element and 1 <body-id> 
element.
So, I have written my query as:
cts:score(cts:search(/doc:document,           cts:or-query((                   
cts:element-value-query(xs:QName("title-csid"),("4682"),(),10.0),               
        cts:element-value-query(xs:QName("body-csid"),("4682"),(),0.0006),      
                 
cts:element-value-query(xs:QName("section-csid"),("4682"),(),6.0),              
         cts:element-query(xs:QName("doc:primaryChemistryAsset"),(),8.0)        
   )),     ("score-simple")))
But this returns extremely high scores in the order of 2^N. Example for a 
document containing only <title-csid> element matching "4682" it returned a 
score of 2048. I was expecting the result to be 8*10.0 = 80.0
Is their something I am missing here?
Any kind of help will be highly appreciated.
Thanks,Isha
                                          
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to