xapian-core  1.4.27
Functions
dbcheck.cc File Reference

test database contents and consistency. More...

#include <config.h>
#include "dbcheck.h"
#include "str.h"
#include "testsuite.h"
+ Include dependency graph for dbcheck.cc:

Go to the source code of this file.

Functions

string positions_to_string (Xapian::PositionIterator &it, const Xapian::PositionIterator &end, Xapian::termcount *count)
 Convert the list of positions in a positionlist to a string. More...
 
string postlist_to_string (const Xapian::Database &db, const string &tname)
 Convert the list of postings in a postlist to a string. More...
 
string docterms_to_string (const Xapian::Database &db, Xapian::docid did)
 Convert the list of terms in a document to a string. More...
 
string docstats_to_string (const Xapian::Database &db, Xapian::docid did)
 Convert statistics about a document to a string. More...
 
string termstats_to_string (const Xapian::Database &db, const string &term)
 Convert statistics about a term to a string. More...
 
void dbcheck (const Xapian::Database &db, Xapian::doccount expected_doccount, Xapian::docid expected_lastdocid)
 Check consistency of database and statistics. More...
 

Detailed Description

test database contents and consistency.

Definition in file dbcheck.cc.

Function Documentation

◆ dbcheck()

void dbcheck ( const Xapian::Database db,
Xapian::doccount  expected_doccount,
Xapian::docid  expected_lastdocid 
)

◆ docstats_to_string()

string docstats_to_string ( const Xapian::Database db,
Xapian::docid  did 
)

Convert statistics about a document to a string.

Definition at line 105 of file dbcheck.cc.

References Xapian::Database::get_doclength(), and Xapian::Internal::str().

Referenced by DEFINE_TESTCASE().

◆ docterms_to_string()

string docterms_to_string ( const Xapian::Database db,
Xapian::docid  did 
)

Convert the list of terms in a document to a string.

This will include positional information when such information is present.

Definition at line 82 of file dbcheck.cc.

References positions_to_string(), Xapian::Internal::str(), Xapian::Database::termlist_begin(), and Xapian::Database::termlist_end().

Referenced by DEFINE_TESTCASE().

◆ positions_to_string()

string positions_to_string ( Xapian::PositionIterator it,
const Xapian::PositionIterator end,
Xapian::termcount count = NULL 
)

Convert the list of positions in a positionlist to a string.

Parameters
itThe start iterator for the positionlist. This will be moved.
endThe end iterator for the positionlist.
countIf not NULL, a pointer to a value which will be set to the number of positions found.

Definition at line 33 of file dbcheck.cc.

References Xapian::Internal::str().

Referenced by dbcheck(), docterms_to_string(), and postlist_to_string().

◆ postlist_to_string()

string postlist_to_string ( const Xapian::Database db,
const std::string &  tname 
)

Convert the list of postings in a postlist to a string.

This will include positional information when such information is present.

Definition at line 55 of file dbcheck.cc.

References positions_to_string(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), and Xapian::Internal::str().

Referenced by check_equal_dbs(), and DEFINE_TESTCASE().

◆ termstats_to_string()

string termstats_to_string ( const Xapian::Database db,
const string &  term 
)

Convert statistics about a term to a string.

Definition at line 115 of file dbcheck.cc.

References Xapian::Database::get_collection_freq(), Xapian::Database::get_termfreq(), and Xapian::Internal::str().

Referenced by DEFINE_TESTCASE().