matcher/multimatch.cc File Reference

#include <config.h>
#include "multimatch.h"
#include "submatch.h"
#include "localmatch.h"
#include "emptysubmatch.h"
#include "omdebug.h"
#include "omenquireinternal.h"
#include "emptypostlist.h"
#include "branchpostlist.h"
#include "leafpostlist.h"
#include "mergepostlist.h"
#include "document.h"
#include "omqueryinternal.h"
#include "stats.h"
#include "msetcmp.h"
#include <xapian/errorhandler.h>
#include <xapian/version.h>
#include "remotesubmatch.h"
#include "remote-database.h"
#include <algorithm>
#include <cfloat>
#include <queue>
#include <vector>
#include <map>
#include <set>

Include dependency graph for multimatch.cc:

Go to the source code of this file.

Functions

static void split_rset_by_db (const Xapian::RSet *rset, Xapian::doccount number_of_subdbs, vector< Xapian::RSet > &subrsets)
 Split an RSet into several sub rsets, one for each database.
static void prepare_sub_matches (std::vector< Xapian::Internal::RefCntPtr< SubMatch > > &leaves, Xapian::ErrorHandler *errorhandler, Stats &stats)
 Prepare some SubMatches.

Variables

const Xapian::Enquire::Internal::sort_setting REL
const Xapian::Enquire::Internal::sort_setting REL_VAL
const Xapian::Enquire::Internal::sort_setting VAL


Function Documentation

static void split_rset_by_db ( const Xapian::RSet rset,
Xapian::doccount  number_of_subdbs,
vector< Xapian::RSet > &  subrsets 
) [static]

Split an RSet into several sub rsets, one for each database.

Parameters:
rset The RSet to split.
number_of_subdbs The number of sub databases which exist.
subrsets Vector of RSets which will the sub rsets will be placed in. This should be empty when the function is called.

Definition at line 84 of file multimatch.cc.

References Assert, DEBUGCALL_STATIC, and Xapian::RSet::internal.

Referenced by MultiMatch::MultiMatch().

static void prepare_sub_matches ( std::vector< Xapian::Internal::RefCntPtr< SubMatch > > &  leaves,
Xapian::ErrorHandler errorhandler,
Stats stats 
) [static]

Prepare some SubMatches.

This calls the prepare_match() method on each SubMatch object, causing them to lookup various statistics.

This method is rather complicated in order to handle remote matches efficiently. Instead of simply calling "prepare_match()" on each submatch and waiting for it to return, it first calls "prepare_match(true)" on each submatch. If any of these calls return false, indicating that the required information has not yet been received from the server, the method will try those which returned false again, passing "false" as a parameter to indicate that they should block until the information is ready.

This should improve performance in the case of mixed local-and-remote searches - the local searchers will all fetch their statistics from disk without waiting for the remote searchers, so as soon as the remote searcher statistics arrive, we can move on to the next step.

Definition at line 138 of file multimatch.cc.

References DEBUGCALL_STATIC, and DEBUGLINE.

Referenced by MultiMatch::MultiMatch().


Variable Documentation

const Xapian::Enquire::Internal::sort_setting REL

Initial value:

Definition at line 65 of file multimatch.cc.

Referenced by MultiMatch::get_mset(), and MultiMatch::MultiMatch().

const Xapian::Enquire::Internal::sort_setting REL_VAL

Initial value:

Definition at line 67 of file multimatch.cc.

Referenced by MultiMatch::get_mset(), and MultiMatch::MultiMatch().

const Xapian::Enquire::Internal::sort_setting VAL

Initial value:

Definition at line 69 of file multimatch.cc.

Referenced by MultiMatch::get_mset().


Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.