xapian-core  1.4.26
Functions
dbcheck.h File Reference

test database contents and consistency. More...

#include <xapian.h>
#include <string>
+ Include dependency graph for dbcheck.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::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. More...
 
std::string postlist_to_string (const Xapian::Database &db, const std::string &tname)
 Convert the list of postings in a postlist to a string. More...
 
std::string docterms_to_string (const Xapian::Database &db, Xapian::docid did)
 Convert the list of terms in a document to a string. More...
 
std::string docstats_to_string (const Xapian::Database &db, Xapian::docid did)
 Convert statistics about a document to a string. More...
 
std::string termstats_to_string (const Xapian::Database &db, const std::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.h.

Function Documentation

◆ dbcheck()

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

◆ docstats_to_string()

std::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()

std::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()

std::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()

std::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()

std::string termstats_to_string ( const Xapian::Database db,
const std::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().