[Xapian-tickets] [Xapian] #340: PostingSource subclasses cannot signal a change in their maxweight

Xapian nobody at xapian.org
Thu May 7 18:43:47 BST 2009


#340: PostingSource subclasses cannot signal a change in their maxweight
-------------------------+--------------------------------------------------
 Reporter:  richard      |        Owner:  richard  
     Type:  defect       |       Status:  closed   
 Priority:  normal       |    Milestone:  1.1.1    
Component:  Library API  |      Version:  SVN trunk
 Severity:  normal       |   Resolution:  fixed    
 Keywords:               |    Blockedby:           
 Platform:  All          |     Blocking:           
-------------------------+--------------------------------------------------

Comment(by olly):

 Hmm, this API probably seems rather esoteric to the user (your class calls
 a method to say it has changed, and then later someone calls a method on
 your class to find out what it actually changed to?!?), and probably
 leaves them very uncertain if/when to actually call it.

 Perhaps it would be better for the subclass to report when its maxweight
 changes and ''specify what the new maxweight is''?  Then the matcher
 wouldn't need to do its recursive recalculation (that's really only needed
 when the tree has pruned) - it would just need to keep track of a
 postingsource's maxweight and reduce its own maxweight by the difference
 between the postingsource's old and new maxweights.  Or perhaps the
 subclass should supply both old and new?  You've implemented more of these
 than I have, so maybe you can see if you tend to have the old max weight
 available naturally.

 Without a recursive walk of the postlist tree, this should be cheap enough
 to call pretty much whenever the maxweight reduces (unless the maxweight
 is inherently expensive to calculate, but that's something the user should
 have an understanding of as it is their implementation).  It might still
 be better to avoid if there's a small reduction for every document (like
 an exponentially decaying weight function), but again that's something the
 user should be able to easily grasp.

-- 
Ticket URL: <http://trac.xapian.org/ticket/340#comment:5>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list