matcher/multimatch.cc File Reference

#include <config.h>
#include "multimatch.h"
#include "autoptr.h"
#include "collapser.h"
#include "debuglog.h"
#include "submatch.h"
#include "localsubmatch.h"
#include "omassert.h"
#include "omenquireinternal.h"
#include "emptypostlist.h"
#include "branchpostlist.h"
#include "mergepostlist.h"
#include "document.h"
#include "omqueryinternal.h"
#include "msetcmp.h"
#include "valuestreamdocument.h"
#include "weightinternal.h"
#include <xapian/errorhandler.h>
#include <xapian/matchspy.h>
#include <xapian/version.h>
#include "remotesubmatch.h"
#include "remote-database.h"
#include <algorithm>
#include <cfloat>
#include <climits>
#include <vector>
#include <map>
#include <set>

Include dependency graph for multimatch.cc:

Go to the source code of this file.

Classes

class  MultipleMatchSpy
 Class which applies several match spies in turn. More...

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 (vector< Xapian::Internal::RefCntPtr< SubMatch > > &leaves, Xapian::ErrorHandler *errorhandler, Xapian::Weight::Internal &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 prepare_sub_matches ( vector< Xapian::Internal::RefCntPtr< SubMatch > > &  leaves,
Xapian::ErrorHandler errorhandler,
Xapian::Weight::Internal 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 LOGCALL_STATIC_VOID, LOGLINE, and SubMatch::prepare_match().

Referenced by MultiMatch::MultiMatch().

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 87 of file multimatch.cc.

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

Referenced by MultiMatch::MultiMatch().


Variable Documentation

Initial value:

Definition at line 68 of file multimatch.cc.

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

Initial value:

Definition at line 70 of file multimatch.cc.

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

Initial value:

Definition at line 72 of file multimatch.cc.

Referenced by MultiMatch::get_mset().


Documentation for Xapian (version 1.2.13).
Generated on 9 Jan 2013 by Doxygen 1.5.9.