xapian-core  2.0.0
Functions
multi.h File Reference

Multi-database support functions. More...

#include <xapian/types.h>
#include "omassert.h"
+ Include dependency graph for multi.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Xapian::docid shard_docid (Xapian::docid did, Xapian::doccount n_shards)
 Convert docid in the multi-db to the docid in the shard. More...
 
Xapian::doccount shard_number (Xapian::docid did, Xapian::doccount n_shards)
 Convert docid in the multi-db to shard number. More...
 
Xapian::docid unshard (Xapian::docid shard_did, Xapian::doccount shard, Xapian::doccount n_shards)
 Convert shard number and shard docid to docid in multi-db. More...
 

Detailed Description

Multi-database support functions.

Definition in file multi.h.

Function Documentation

◆ shard_docid()

Xapian::docid shard_docid ( Xapian::docid  did,
Xapian::doccount  n_shards 
)
inline

◆ shard_number()

Xapian::doccount shard_number ( Xapian::docid  did,
Xapian::doccount  n_shards 
)
inline

◆ unshard()

Xapian::docid unshard ( Xapian::docid  shard_did,
Xapian::doccount  shard,
Xapian::doccount  n_shards 
)
inline

Convert shard number and shard docid to docid in multi-db.

Parameters
shard_diddocid in the shard
shardshard number between 0 and (n_shards - 1) inclusive
n_shardsnumber of dbs in the multi-db
Returns
docid in the multi-db.

Definition at line 64 of file multi.h.

References Assert, and AssertRel.

Referenced by PostListTree::get_docid(), MultiDatabase::get_lastdocid(), SubValueList::get_merged_docid(), MultiPostList::next(), MultiPostList::skip_to(), test_shard1(), and Result::unshard_docid().