[Xapian-tickets] [Xapian] #213: Expose statistics to user defined Xapian::Weight subclasses

Xapian nobody at xapian.org
Tue Feb 17 04:00:28 GMT 2009


#213: Expose statistics to user defined Xapian::Weight subclasses
-------------------------+--------------------------------------------------
 Reporter:  richard      |        Owner:  olly     
     Type:  defect       |       Status:  assigned 
 Priority:  normal       |    Milestone:  1.1.0    
Component:  Library API  |      Version:  SVN trunk
 Severity:  normal       |   Resolution:           
 Keywords:               |    Blockedby:           
 Platform:  All          |     Blocking:           
-------------------------+--------------------------------------------------
Changes (by olly):

  * status:  new => assigned


Old description:

> Currently, The Xapian::Weight::Internal class (which is, as of last
> night, the
> class holding the statistics for the whole collection used by the weight
> objects) is not publically visible.  This means that it would be
> impossible, for
> example, for a user to write a weighting class equivalent to, say, the
> BM25Weight class, using the public API, because the statistics aren't
> available.
>  After cleaning up the weighting calculation system, I believe the
> Xapian::Weight::Internal class is now nearly clean enough that it could
> reasonably be made public, allowing custom weighting classes access to
> all the
> statistics currently available.
>
> We might want to make the termfreq and reltermfreq members private, since
> they're likely to be accessed mainly through the accessor functions
> anyway.
> Also we might want to combine them into a single map with entries holding
> both
> the termfreq and the reltermfreq, since it's usual to want to access both
> the
> termfreq and the reltermfreq for a particular term at the same time.
>
> Also, we might want to call the class Xapian::Stats, instead of
> Xapian::Weight::Internal, to reflect the Stats being part of the public
> API, but
> this would require an ABI change, so would have to wait for 1.1.0.  (We
> could
> keep the API compatible by making Xapian::Weight::Internal a typedef for
> Xapian::Stats, I think; currently Stats (with no namespace) is a typedef
> for
> Xapian::Weight::Internal).

New description:

 Currently, The Xapian::Weight::Internal class (which is, as of last night,
 the
 class holding the statistics for the whole collection used by the weight
 objects) is not publically visible.  This means that it would be
 impossible, for
 example, for a user to write a weighting class equivalent to, say, the
 BM25Weight class, using the public API, because the statistics aren't
 available.

 After cleaning up the weighting calculation system, I believe the
 Xapian::Weight::Internal class is now nearly clean enough that it could
 reasonably be made public, allowing custom weighting classes access to all
 the
 statistics currently available.

 We might want to make the termfreq and reltermfreq members private, since
 they're likely to be accessed mainly through the accessor functions
 anyway.
 Also we might want to combine them into a single map with entries holding
 both
 the termfreq and the reltermfreq, since it's usual to want to access both
 the
 termfreq and the reltermfreq for a particular term at the same time.

 Also, we might want to call the class Xapian::Stats, instead of
 Xapian::Weight::Internal, to reflect the Stats being part of the public
 API, but
 this would require an ABI change, so would have to wait for 1.1.0.  (We
 could
 keep the API compatible by making Xapian::Weight::Internal a typedef for
 Xapian::Stats, I think; currently Stats (with no namespace) is a typedef
 for
 Xapian::Weight::Internal).

--

Comment:

 Yes - I was working on it yesterday in fact (while I waited for my DSL to
 be fixed).

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



More information about the Xapian-tickets mailing list