[Xapian-tickets] [Xapian] #433: MatchSpy should allow early termination

Xapian nobody at xapian.org
Mon Feb 1 20:08:08 GMT 2010


#433: MatchSpy should allow early termination
-------------------------+--------------------------------------------------
 Reporter:  richard      |       Owner:  olly     
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  1.1.7    
Component:  Matcher      |     Version:  SVN trunk
 Severity:  normal       |    Keywords:           
Blockedby:               |    Platform:  All      
 Blocking:               |  
-------------------------+--------------------------------------------------

Comment(by richard):

 I've just been playing with potential implementations for this.

 Implementation (a) is quite easy to do; there don't seem to be any
 unexpected complications.

 Implementation (b) gets tricky.  The natural user assumption, if a
 matchspy were able to return a minimum weight required, would be that it
 would be shown all matching documents which have a weight higher than that
 weight.  Currently, the matchspy is just "along for the ride" with the
 rest of the matcher, so may well not be shown documents even if they have
 a higher weight than that requested: the only way to avoid this currently
 is to set a high enough checkatleast value.

 If taking the implementation (b) approach, the returned weight is
 therefore only useful if it is able to override the minweight calculated
 by the normal matching code, if the matchspy's minweight is lower.  In
 turn, if we changed the behaviour so that that happened, there'd be no way
 for a matchspy to indicate that it doesn't want to control the documents
 looked at by the matcher (ie, there'd be no way to obtain the current
 "along for the ride" behaviour).

 My current feeling is that the best approach to get all the features
 mentioned above would be to leave !MatchSpy::operator() returning void,
 and add some extra methods to the base class to allow communication with
 the matcher: in particular, a method to say "I'm finished", a method to
 indicate the the matchspy wants to see all matching documents returned
 from the postlist tree, and a method to indicate the minimum weight of
 document from the postlist tree that the matchspy is interested in.  (The
 latter two methods could quite possibly be combined.)

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



More information about the Xapian-tickets mailing list