Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

include/xapian/database.h File Reference

API for working with Xapian databases. More...

#include <string>
#include <vector>
#include <xapian/base.h>
#include <xapian/types.h>

Include dependency graph for database.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  Xapian
namespace  Xapian::Auto
namespace  Xapian::Quartz
namespace  Xapian::InMemory
namespace  Xapian::Muscat36
namespace  Xapian::Remote

Classes

class  Xapian::Database
 This class is used to access a database, or a group of databases. More...
class  Xapian::WritableDatabase
 This class provides read/write access to a database. More...

Functions

Database open (const std::string &path)
 Open a Quartz database read-only.
WritableDatabase open (const std::string &path, int action)
 Open a database for update, automatically determining the database backend to use.
Database open_stub (const std::string &file)
 Open a stub database.
Database open (const std::string &dir)
 Open a Quartz database read-only.
WritableDatabase open (const std::string &dir, int action, int block_size=8192)
 Open a Quartz database for update.
WritableDatabase open ()
 Open an InMemory database for update.
Database open_da (const std::string &R, const std::string &T, bool heavy_duty=true)
 Open a Muscat 3.6 DA database.
Database open_da (const std::string &R, const std::string &T, const std::string &values, bool heavy_duty=true)
 Open a Muscat 3.6 DA database.
Database open_db (const std::string &DB, size_t cache_size=30)
 Open a Muscat 3.6 DB database.
Database open_db (const std::string &DB, const std::string &values, size_t cache_size=30)
 Open a Muscat 3.6 DB database.
Database open (const std::string &program, const std::string &args, Xapian::timeout timeout=10000)
 Open a remote database (using a program).
Database open (const std::string &host, unsigned int port, Xapian::timeout timeout=10000, Xapian::timeout connect_timeout=0)
 Open a remote database (using a TCP connection).

Variables

const int DB_CREATE_OR_OPEN = 1
const int DB_CREATE = 2
const int DB_CREATE_OR_OVERWRITE = 3
const int DB_OPEN = 4


Detailed Description

API for working with Xapian databases.


Function Documentation

Database open const std::string &  host,
unsigned int  port,
Xapian::timeout  timeout = 10000,
Xapian::timeout  connect_timeout = 0
 

Open a remote database (using a TCP connection).

This opens a remote database by connecting to the specified TCP port on the specified host.

Parameters:
host the name of the host running a tcp server
port the port on which the tcp server is running
timeout how long to wait for a response (in milliseconds). If this timeout is reached for any operation, then a Xapian::NetworkTimeoutError exception will be thrown. The default if not specified is 10000ms (10 seconds).
connect_timeout how long to wait when attempting to connect to the server. If this timeout is reached when attempting to connect, then a Xapian::NetworkTimeoutError exception wil be thrown. The default if not specified is to use the same value given for timeout.

Database open const std::string &  program,
const std::string &  args,
Xapian::timeout  timeout = 10000
 

Open a remote database (using a program).

This opens a remote database by running a program which it communicates with on stdin/stdout.

Parameters:
program the program to run
arguments the arguments to pass to the program
timeout how long to wait for a response (in milliseconds). If this timeout is reached for any operation, then a Xapian::NetworkTimeoutError exception will be thrown. The default if not specified is 10000ms (i.e. 10 seconds).

WritableDatabase open  ) 
 

Open an InMemory database for update.

WritableDatabase open const std::string &  dir,
int  action,
int  block_size = 8192
 

Open a Quartz database for update.

Parameters:
dir directory that the database is stored in.
action one of:
  • Xapian::DB_CREATE_OR_OPEN open for read/write; create if no db exists
  • Xapian::DB_CREATE create new database; fail if db exists
  • Xapian::DB_CREATE_OR_OVERWRITE overwrite existing db; create if none exists
  • Xapian::DB_OPEN open for read/write; fail if no db exists
block_size the size in bytes of the blocks to use in the tables. Acceptable values are powers of two in the range 2048 to 65536 (inclusive) - passing other values, or not specifying a value, will give a block size of 8192 bytes. This setting is only used when creating databases. If the database already exists, it is completely ignored.

Database open const std::string &  path  )  [inline]
 

Open a Quartz database read-only.

This function is deprecated - use Xapian::Database(path) instead.

Parameters:
path directory that the database is stored in.

WritableDatabase open const std::string &  path,
int  action
[inline]
 

Open a database for update, automatically determining the database backend to use.

This function is deprecated - use Xapian::WritableDatabase(path) instead.

Database open const std::string &  path  )  [inline]
 

Open a Quartz database read-only.

This function is deprecated - use Xapian::Database(path) instead.

Parameters:
path directory that the database is stored in.

Database open_da const std::string &  R,
const std::string &  T,
const std::string &  values,
bool  heavy_duty = true
 

Open a Muscat 3.6 DA database.

This opens a DA database with a values file.

Parameters:
R filename of the Record file
T filename of the Term file
values filename of the values file
heavy_duty is this database heavy-duty (3 byte lengths) or flimsy (2 byte lengths)

Database open_da const std::string &  R,
const std::string &  T,
bool  heavy_duty = true
 

Open a Muscat 3.6 DA database.

This opens a DA database with no values file.

Parameters:
R filename of the Record file
T filename of the Term file
heavy_duty is this database heavy-duty (3 byte lengths) or flimsy (2 byte lengths)

Database open_db const std::string &  DB,
const std::string &  values,
size_t  cache_size = 30
 

Open a Muscat 3.6 DB database.

This opens a DB database with a values file. The backend auto-detects if the database is heavy-duty or flimsy.

Parameters:
DB filename of the database btree file
values filename of the values file
cache_size how many blocks to cache (default 30).

Database open_db const std::string &  DB,
size_t  cache_size = 30
 

Open a Muscat 3.6 DB database.

This opens a DB database with no values file. The backend auto-detects if the database is heavy-duty or flimsy.

Parameters:
DB filename of the database btree file
cache_size how many blocks to cache

Database open_stub const std::string &  file  ) 
 

Open a stub database.

This opens a file which contains types and serialised parameters for one or more databases.

Parameters:
file the stub database file


Documentation for Xapian (version 0.8.5).
Generated on 23 Dec 2004 by Doxygen 1.3.8.