MyWeight Class Reference

Inheritance diagram for MyWeight:

Inheritance graph
[legend]
Collaboration diagram for MyWeight:

Collaboration graph
[legend]
List of all members.

Public Member Functions

MyWeightclone () const
 Return a new weight object of this type.
 MyWeight ()
 ~MyWeight ()
std::string name () const
 Name of the weighting scheme.
std::string serialise () const
 Serialise object parameters into a string.
MyWeightunserialise (const std::string &) const
 Create object given string serialisation returned by serialise().
Xapian::weight get_sumpart (Xapian::termcount, Xapian::doclength) const
 Get a weight which is part of the sum over terms being performed.
Xapian::weight get_maxpart () const
 Gets the maximum value that get_sumpart() may return.
Xapian::weight get_sumextra (Xapian::doclength) const
 Get an extra weight for a document to add to the sum calculated over the query terms.
Xapian::weight get_maxextra () const
 Gets the maximum value that get_sumextra() may return.
bool get_sumpart_needs_doclength () const
 return false if the weight object doesn't need doclength

Detailed Description

Definition at line 1765 of file api_db.cc.


Constructor & Destructor Documentation

MyWeight::MyWeight (  )  [inline]

Definition at line 1770 of file api_db.cc.

MyWeight::~MyWeight (  )  [inline]

Definition at line 1771 of file api_db.cc.


Member Function Documentation

MyWeight* MyWeight::clone (  )  const [inline, virtual]

Return a new weight object of this type.

A subclass called FooWeight taking parameters param1 and param2 should implement this as:

virtual FooWeight * clone() const { return new FooWeight(param1, param2); }

Implements Xapian::Weight.

Definition at line 1767 of file api_db.cc.

std::string MyWeight::name (  )  const [inline, virtual]

Name of the weighting scheme.

If the subclass is called FooWeight, this should return "Foo".

Implements Xapian::Weight.

Definition at line 1772 of file api_db.cc.

std::string MyWeight::serialise (  )  const [inline, virtual]

Serialise object parameters into a string.

Implements Xapian::Weight.

Definition at line 1773 of file api_db.cc.

MyWeight* MyWeight::unserialise ( const std::string &  s  )  const [inline, virtual]

Create object given string serialisation returned by serialise().

Implements Xapian::Weight.

Definition at line 1774 of file api_db.cc.

Xapian::weight MyWeight::get_sumpart ( Xapian::termcount  wdf,
Xapian::doclength  len 
) const [inline, virtual]

Get a weight which is part of the sum over terms being performed.

This returns a weight for a given term and document. These weights are summed to give a total weight for the document.

Parameters:
wdf the within document frequency of the term.
len the (unnormalised) document length.

Implements Xapian::Weight.

Definition at line 1777 of file api_db.cc.

Xapian::weight MyWeight::get_maxpart (  )  const [inline, virtual]

Gets the maximum value that get_sumpart() may return.

This is used in optimising searches, by having the postlist tree decay appropriately when parts of it can have limited, or no, further effect.

Implements Xapian::Weight.

Definition at line 1778 of file api_db.cc.

Xapian::weight MyWeight::get_sumextra ( Xapian::doclength  len  )  const [inline, virtual]

Get an extra weight for a document to add to the sum calculated over the query terms.

This returns a weight for a given document, and is used by some weighting schemes to account for influence such as document length.

Parameters:
len the (unnormalised) document length.

Implements Xapian::Weight.

Definition at line 1780 of file api_db.cc.

Xapian::weight MyWeight::get_maxextra (  )  const [inline, virtual]

Gets the maximum value that get_sumextra() may return.

This is used in optimising searches.

Implements Xapian::Weight.

Definition at line 1781 of file api_db.cc.

bool MyWeight::get_sumpart_needs_doclength (  )  const [inline, virtual]

return false if the weight object doesn't need doclength

Reimplemented from Xapian::Weight.

Definition at line 1783 of file api_db.cc.


The documentation for this class was generated from the following file:
Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.