CmpMaxOrTerms Struct Reference

Class providing an operator which sorts postlists to select max or terms. More...

List of all members.

Public Member Functions

bool operator() (const PostList *a, const PostList *b)
 Return true if and only if a has a strictly greater termweight than b; with the proviso that if the termfrequency of a or b is 0, then the termweight is considered to be 0.


Detailed Description

Class providing an operator which sorts postlists to select max or terms.

This returns true if a has a (strictly) greater termweight than b, unless a or b contain no documents, in which case the other one is selected.

Definition at line 236 of file queryoptimiser.cc.


Member Function Documentation

bool CmpMaxOrTerms::operator() ( const PostList a,
const PostList b 
) [inline]

Return true if and only if a has a strictly greater termweight than b; with the proviso that if the termfrequency of a or b is 0, then the termweight is considered to be 0.

We use termfreq_max() because we really don't want to exclude a postlist which has a low but non-zero termfrequency: the estimate is quite likely to be zero in this case.

Definition at line 245 of file queryoptimiser.cc.

References Xapian::PostingIterator::Internal::get_maxweight(), and Xapian::PostingIterator::Internal::get_termfreq_max().


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