[Xapian-tickets] [Xapian] #359: MultiValueSorter::add() and Enquire::set_sort_by_value() inconsistency

Xapian nobody at xapian.org
Thu Jul 16 04:59:02 BST 2009


#359: MultiValueSorter::add() and Enquire::set_sort_by_value() inconsistency
-------------------------+--------------------------------------------------
 Reporter:  olly         |       Owner:  olly    
     Type:  defect       |      Status:  assigned
 Priority:  highest      |   Milestone:  1.1.3   
Component:  Library API  |     Version:  1.1.0   
 Severity:  normal       |    Keywords:          
Blockedby:               |    Platform:  All     
 Blocking:               |  
-------------------------+--------------------------------------------------
Changes (by olly):

  * milestone:  1.1.7 => 1.1.3


Comment:

 I'm thinking that this is worth fixing - this sort of API inconsistency is
 likely to trip up users, and at best it is ugly.  !MultiValueSorter was
 added during 1.0.x, so we can't just change the default, but it is fairly
 new and fairly specialised, so it probably doesn't yet have a huge number
 of users, so I think the pain of migrating it worthwhile in this case.

 {{{MultiValueSorter::add(7)}}} is fine, but the two parameter form has the
 second parameter with the wrong sense.  I think that means that we need to
 rename the class or the method really - my thoughts are either:

  * Rename the class to !MultiSorter and provide the existing class for
 compatibility (but deprecate it).

  * Rename the method to add_value() and provide the existing add() method
 for compatibility (but deprecate it).

 Document also has an add_value() method, and classes which implement
 things using values tend to have "Value" in their name, so perhaps the
 second is the better approach.

 Thoughts welcome.

 Marking as milestone:1.1.3.

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



More information about the Xapian-tickets mailing list