Hello,

I'm debugging some queries where the scoring doesn't seem to quite
make sense, so I started simplifying things and the building them back
up to see what was going on.  I found two things I don't quite
understand and I was wondering if someone could help me with that.

1) As I add more cts:query statements to my cts:search, the scores of
the nodes decrease by a bit.  I'm not overly concerned about this in
general, but I'm curious why it happens.

Here's an increasingly complex query and the scores of the top 5 nodes
as an example:

cts:word-query("folk music")
-- 2447, 2447, 2447, 2446, 2445

cts:and-query((
  cts:word-query("folk"),
  cts:word-query("music")
))
-- 2228, 2226, 2226, 2224, 2219

cts:or-query((
  cts:and-query((
    cts:word-query("folk"),
    cts:word-query("music")
  ))
  ,
  cts:and-query((
    cts:element-word-query((xs:QName("title"), xs:QName("head"),
xs:QName("entry-head")), "folk"),
    cts:element-word-query((xs:QName("title"), xs:QName("head"),
xs:QName("entry-head")), "music")
  ))
))
-- 2160, 2154, 2154, 2152, 2151

2) That last query is closest to what I'm running in my final XQuery
module. What we also want to do is, when there are hits in head
elements (as defined in the second cts:and-query), we want to have
those items appear significantly higher in the list.  When I added a
weight of 16.0 to the cts:element-word-query leafs of the same query,
the scores dropped even further.  This is the one that caught me
off-guard.  I did check my "element word query through" settings and
they seem to be correct.  What am I missing here?  Why would this
happen?

Here's the same query with the weights set and the scores of the top 5
results again:

cts:or-query((
  cts:and-query((
    cts:word-query("folk"),
    cts:word-query("music")
  ))
  ,
  cts:and-query((
    cts:element-word-query((xs:QName("title"), xs:QName("head"),
xs:QName("entry-head")), "folk", (), 16.0),
    cts:element-word-query((xs:QName("title"), xs:QName("head"),
xs:QName("entry-head")), "music", (), 16.0)
  ))
))
-- 2142, 2137, 2137, 2134, 2133

Thanks for any help with this!
Mattio
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to