xapian-core  1.4.21
Classes | Functions | Variables
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 "api/omenquireinternal.h"
#include "realtime.h"
#include "api/emptypostlist.h"
#include "branchpostlist.h"
#include "mergepostlist.h"
#include "backends/document.h"
#include "msetcmp.h"
#include "valuestreamdocument.h"
#include "weight/weightinternal.h"
#include <xapian/error.h>
#include <xapian/matchspy.h>
#include <xapian/version.h>
#include "remotesubmatch.h"
#include "backends/remote/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  TimeOut
 
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. More...
 
static void prepare_sub_matches (vector< intrusive_ptr< SubMatch > > &leaves, Xapian::Weight::Internal &stats)
 Prepare some SubMatches. More...
 

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

◆ prepare_sub_matches()

static void prepare_sub_matches ( vector< intrusive_ptr< SubMatch > > &  leaves,
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 224 of file multimatch.cc.

References LOGCALL_STATIC_VOID, and SubMatch::prepare_match().

Referenced by MultiMatch::MultiMatch().

◆ split_rset_by_db()

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
rsetThe RSet to split.
number_of_subdbsThe number of sub databases which exist.
subrsetsVector of RSets which will the sub rsets will be placed in. This should be empty when the function is called.

Definition at line 173 of file multimatch.cc.

References Assert, Xapian::RSet::empty(), Xapian::RSet::internal, and LOGCALL_STATIC_VOID.

Referenced by MultiMatch::MultiMatch().

Variable Documentation

◆ REL

◆ REL_VAL

◆ VAL