Title: Message
Hi Marc,
 
I am not sure what your xml looks like for your encyclopedias:  Does your if:headword element correspond to the article title?  Searching the title and weighting it higher is a good approach.  I think you have the right general approach here, but perhaps you might need to experiment with the weight numbers a little to acheive your desired approach.  For example, try lowering the sage:def number below 1.0 (maybe .75?) and/or raising the if:headword number a little more (maybe 6). 
 
Also, keep in mind that the relevance scores are based on the term frequency and the document frequency (logtf/idf).   So if there are many more occurances of "kennedy" in the Bay of Pigs article than there are in his biography, you will need a bigger boost to raise the relevance above the Bay of Pigs.  The weight numbers do not multiply the score by the weight; rather, they boost or lower the contribution of that query constructor's contribution to the score.
 
Another approach you can take is to add quality to the documents, giving the biography a higher quality than the Bay of Pigs article, and then specify the QualityWeight in your cts:search.
 
There is a little info on this in the "Relevance Scores: Understanding and Customizing" chapter of the Develper's Guide (http://developer.marklogic.com/pubs/3.1/books/dev_guide.pdf).  But the scores will be very data-dependent, so a certain amount of experimentation is probably needed if you want to boost things in this way.
 
-Danny
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc Moskowitz
Sent: Thursday, August 24, 2006 11:58 AM
To: [email protected]
Subject: [MarkLogic Dev General] Weighting parts of an or-query

Greetings!

I’m working with a set of encyclopedias, with the entry as the fragment root. I’m trying to weight my search results so that a search for “kennedy” ranks the entry for John F. Kennedy before the ones for Bay of Pigs and Cuban Missile Crisis. My initial attempt to do this is with the following query:

  cts:or-query

  ((

   cts:element-query(xs:QName("sage:def"),cts:word-query("kennedy",(),1)),

   cts:element-query(xs:QName("if:headword"),cts:word-query("kennedy",(),3))

  ))

However, this does not alter the order, and experimenting with cts:score shows no benefit from the headword query:

Entry                                        Score

Bay of Pigs                               348

Cuban Missile Crisis                  348

Kennedy, John F. (1917–1963)    348

Johnson, Lyndon (1908–1973)     290

Presidential Leadership, U.S.      290

 

What is the correct way to construct this query? Thank you for any help.

 

Marc Moskowitz

Interactive Factory

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

Reply via email to