Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 2dc7ae7102ce788eb8a15dec0caf7708 > files > 184

xapian-core-devel-1.0.21-1.fc13.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Xapian: API Documentation: xapian-core: Xapian::WritableDatabase Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.5.2 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li class="current"><a href="classes.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul>
</div>
<div class="nav">
<a class="el" href="namespaceXapian.html">Xapian</a>::<a class="el" href="classXapian_1_1WritableDatabase.html">WritableDatabase</a></div>
<h1>Xapian::WritableDatabase Class Reference</h1><!-- doxytag: class="Xapian::WritableDatabase" --><!-- doxytag: inherits="Xapian::Database" -->This class provides read/write access to a database.  
<a href="#_details">More...</a>
<p>
Inheritance diagram for Xapian::WritableDatabase:<p><center><img src="classXapian_1_1WritableDatabase__inherit__graph.png" border="0" usemap="#Xapian_1_1WritableDatabase__inherit__map" alt="Inheritance graph"></center>
<map name="Xapian_1_1WritableDatabase__inherit__map">
<area shape="rect" href="classXapian_1_1Database.html" title="This class is used to access a database, or a group of databases." alt="" coords="31,7,164,33"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classXapian_1_1WritableDatabase-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#29f782737bb59479f9288b27c58747b0">~WritableDatabase</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroy this handle on the database.  <a href="#29f782737bb59479f9288b27c58747b0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#90cf020c130ef57d22186015d1f9a71e">WritableDatabase</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create an empty <a class="el" href="classXapian_1_1WritableDatabase.html" title="This class provides read/write access to a database.">WritableDatabase</a>.  <a href="#90cf020c130ef57d22186015d1f9a71e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#377c0889710ebd4eaeaa8f6210dc3b07">WritableDatabase</a> (const std::string &amp;path, int action)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open a database for update, automatically determining the database backend to use.  <a href="#377c0889710ebd4eaeaa8f6210dc3b07"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#052565aa5fae73d46cdf551c8810fe1b">WritableDatabase</a> (const <a class="el" href="classXapian_1_1WritableDatabase.html">WritableDatabase</a> &amp;other)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Copying is allowed.  <a href="#052565aa5fae73d46cdf551c8810fe1b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#3f8b5fca8bf26165683cd79f7ef4bf60">operator=</a> (const <a class="el" href="classXapian_1_1WritableDatabase.html">WritableDatabase</a> &amp;other)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Assignment is allowed.  <a href="#3f8b5fca8bf26165683cd79f7ef4bf60"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732">flush</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Commit any pending modifications made to the database.  <a href="#d0077acafa9485c97b73b8726c375732"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#c4d8b73dcc239e57343fa0c876ef8966">begin_transaction</a> (bool flushed=true)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Begin a transaction.  <a href="#c4d8b73dcc239e57343fa0c876ef8966"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#2c133f9f814d918eec395c64f941ea65">commit_transaction</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Complete the transaction currently in progress.  <a href="#2c133f9f814d918eec395c64f941ea65"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#b4f8f5967e553afe357dd365bf84b835">cancel_transaction</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Abort the transaction currently in progress, discarding the pending modifications made to the database.  <a href="#b4f8f5967e553afe357dd365bf84b835"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceXapian.html#d8d873ad5830cff0b4bbd89d7da45d15">Xapian::docid</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#367b1a512677b2a66354250c6e90a9e7">add_document</a> (const <a class="el" href="classXapian_1_1Document.html">Xapian::Document</a> &amp;document)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a new document to the database.  <a href="#367b1a512677b2a66354250c6e90a9e7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#3a286d6af6894a072bcb8cf208b2fddd">delete_document</a> (<a class="el" href="namespaceXapian.html#d8d873ad5830cff0b4bbd89d7da45d15">Xapian::docid</a> did)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Delete a document from the database.  <a href="#3a286d6af6894a072bcb8cf208b2fddd"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#df08e9e0baaa1245409a1b7a38b3357c">delete_document</a> (const std::string &amp;unique_term)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Delete any documents indexed by a term from the database.  <a href="#df08e9e0baaa1245409a1b7a38b3357c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#8a206aed75514f5559d51a3dfc1cc625">replace_document</a> (<a class="el" href="namespaceXapian.html#d8d873ad5830cff0b4bbd89d7da45d15">Xapian::docid</a> did, const <a class="el" href="classXapian_1_1Document.html">Xapian::Document</a> &amp;document)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Replace a given document in the database.  <a href="#8a206aed75514f5559d51a3dfc1cc625"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceXapian.html#d8d873ad5830cff0b4bbd89d7da45d15">Xapian::docid</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#c4c6d54060301ffc0d99bb1622443e00">replace_document</a> (const std::string &amp;unique_term, const <a class="el" href="classXapian_1_1Document.html">Xapian::Document</a> &amp;document)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Replace any documents matching a term.  <a href="#c4c6d54060301ffc0d99bb1622443e00"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#ba118fe18b5393049e6ae6260f5b957d">add_spelling</a> (const std::string &amp;word, <a class="el" href="namespaceXapian.html#3261017447607738e49eae6a2a4f5eec">Xapian::termcount</a> freqinc=1) const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a word to the spelling dictionary.  <a href="#ba118fe18b5393049e6ae6260f5b957d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#d73fcc0a46a100963dfe4b0ec9856620">remove_spelling</a> (const std::string &amp;word, <a class="el" href="namespaceXapian.html#3261017447607738e49eae6a2a4f5eec">Xapian::termcount</a> freqdec=1) const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove a word from the spelling dictionary.  <a href="#d73fcc0a46a100963dfe4b0ec9856620"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#ae0f927455b1eacbf6d17a84515c11cc">add_synonym</a> (const std::string &amp;term, const std::string &amp;synonym) const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a synonym for a term.  <a href="#ae0f927455b1eacbf6d17a84515c11cc"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#90af693a4a8d1f9ccb616def02881fef">remove_synonym</a> (const std::string &amp;term, const std::string &amp;synonym) const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove a synonym for a term.  <a href="#90af693a4a8d1f9ccb616def02881fef"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#d6d0ed75832ab64c0cc382fd82db4b7c">clear_synonyms</a> (const std::string &amp;term) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove all synonyms for a term.  <a href="#d6d0ed75832ab64c0cc382fd82db4b7c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#4a8d53e528bda6cee8e507b95f5c0b31">set_metadata</a> (const std::string &amp;key, const std::string &amp;value)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the user-specified metadata associated with a given key.  <a href="#4a8d53e528bda6cee8e507b95f5c0b31"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1WritableDatabase.html#24f364f0748df4ef2eedf31bd3bab167">get_description</a> () const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return a string describing this object.  <a href="#24f364f0748df4ef2eedf31bd3bab167"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class provides read/write access to a database. 
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="29f782737bb59479f9288b27c58747b0"></a><!-- doxytag: member="Xapian::WritableDatabase::~WritableDatabase" ref="29f782737bb59479f9288b27c58747b0" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual Xapian::WritableDatabase::~WritableDatabase           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destroy this handle on the database. 
<p>
If there are no copies of this object remaining, the database will be closed. If there are any transactions in progress these will be aborted as if cancel_transaction had been called. 
</div>
</div><p>
<a class="anchor" name="90cf020c130ef57d22186015d1f9a71e"></a><!-- doxytag: member="Xapian::WritableDatabase::WritableDatabase" ref="90cf020c130ef57d22186015d1f9a71e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Xapian::WritableDatabase::WritableDatabase           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create an empty <a class="el" href="classXapian_1_1WritableDatabase.html" title="This class provides read/write access to a database.">WritableDatabase</a>. 
<p>

</div>
</div><p>
<a class="anchor" name="377c0889710ebd4eaeaa8f6210dc3b07"></a><!-- doxytag: member="Xapian::WritableDatabase::WritableDatabase" ref="377c0889710ebd4eaeaa8f6210dc3b07" args="(const std::string &amp;path, int action)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Xapian::WritableDatabase::WritableDatabase           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>action</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Open a database for update, automatically determining the database backend to use. 
<p>
If the database is to be created, <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> will try to create the directory indicated by path if it doesn't already exist (but only the leaf directory, not recursively).<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>path</em>&nbsp;</td><td>directory that the database is stored in. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>action</em>&nbsp;</td><td>one of:<ul>
<li><a class="el" href="namespaceXapian.html#03b7f9f4a58459ca435b11b563e58ad1" title="Open for read/write; create if no db exists.">Xapian::DB_CREATE_OR_OPEN</a> open for read/write; create if no db exists</li><li><a class="el" href="namespaceXapian.html#d01f62a9f2bd0310f8bab1025b084dce" title="Create a new database; fail if db exists.">Xapian::DB_CREATE</a> create new database; fail if db exists</li><li><a class="el" href="namespaceXapian.html#3c05f09a4d634681eebc456f0a6544ab" title="Overwrite existing db; create if none exists.">Xapian::DB_CREATE_OR_OVERWRITE</a> overwrite existing db; create if none exists</li><li><a class="el" href="namespaceXapian.html#ab6b9a465af84f701de4cb59dd9a4767" title="Open for read/write; fail if no db exists.">Xapian::DB_OPEN</a> open for read/write; fail if no db exists</li></ul>
</td></tr>
  </table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseCorruptError.html" title="DatabaseCorruptError indicates database corruption was detected.">Xapian::DatabaseCorruptError</a></em>&nbsp;</td><td>will be thrown if the database is in a corrupt state.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseLockError.html" title="DatabaseLockError indicates failure to lock a database.">Xapian::DatabaseLockError</a></em>&nbsp;</td><td>will be thrown if a lock couldn't be acquired on the database. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="052565aa5fae73d46cdf551c8810fe1b"></a><!-- doxytag: member="Xapian::WritableDatabase::WritableDatabase" ref="052565aa5fae73d46cdf551c8810fe1b" args="(const WritableDatabase &amp;other)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Xapian::WritableDatabase::WritableDatabase           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classXapian_1_1WritableDatabase.html">WritableDatabase</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>other</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Copying is allowed. 
<p>
The internals are reference counted, so copying is cheap. 
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="3f8b5fca8bf26165683cd79f7ef4bf60"></a><!-- doxytag: member="Xapian::WritableDatabase::operator=" ref="3f8b5fca8bf26165683cd79f7ef4bf60" args="(const WritableDatabase &amp;other)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::operator=           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classXapian_1_1WritableDatabase.html">WritableDatabase</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>other</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Assignment is allowed. 
<p>
The internals are reference counted, so assignment is cheap.<p>
Note that only an <a class="el" href="classXapian_1_1WritableDatabase.html" title="This class provides read/write access to a database.">WritableDatabase</a> may be assigned to an <a class="el" href="classXapian_1_1WritableDatabase.html" title="This class provides read/write access to a database.">WritableDatabase</a>: an attempt to assign a <a class="el" href="classXapian_1_1Database.html" title="This class is used to access a database, or a group of databases.">Database</a> is caught at compile-time. 
</div>
</div><p>
<a class="anchor" name="d0077acafa9485c97b73b8726c375732"></a><!-- doxytag: member="Xapian::WritableDatabase::flush" ref="d0077acafa9485c97b73b8726c375732" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::flush           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Commit any pending modifications made to the database. 
<p>
For efficiency reasons, when performing multiple updates to a database it is best (indeed, almost essential) to make as many modifications as memory will permit in a single pass through the database. To ensure this, <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> batches up modifications.<p>
Flush may be called at any time to ensure that the modifications which have been made are written to disk: if the flush succeeds, all the preceding modifications will have been written to disk.<p>
If any of the modifications fail, an exception will be thrown and the database will be left in a state in which each separate addition, replacement or deletion operation has either been fully performed or not performed at all: it is then up to the application to work out which operations need to be repeated.<p>
It's not valid to call <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> within a transaction.<p>
Beware of calling <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> too frequently: this will make indexing take much longer.<p>
Note that <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> need not be called explicitly: it will be called automatically when the database is closed, or when a sufficient number of modifications have been made. By default, this is every 10000 documents added, deleted, or modified. This value is rather conservative, and if you have a machine with plenty of memory, you can improve indexing throughput dramatically by setting XAPIAN_FLUSH_THRESHOLD in the environment to a larger value.<p>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseError.html" title="DatabaseError indicates some sort of database related error.">Xapian::DatabaseError</a></em>&nbsp;</td><td>will be thrown if a problem occurs while modifying the database.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseCorruptError.html" title="DatabaseCorruptError indicates database corruption was detected.">Xapian::DatabaseCorruptError</a></em>&nbsp;</td><td>will be thrown if the database is in a corrupt state. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="c4d8b73dcc239e57343fa0c876ef8966"></a><!-- doxytag: member="Xapian::WritableDatabase::begin_transaction" ref="c4d8b73dcc239e57343fa0c876ef8966" args="(bool flushed=true)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::begin_transaction           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>flushed</em> = <code>true</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Begin a transaction. 
<p>
In <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> a transaction is a group of modifications to the database which are linked such that either all will be applied simultaneously or none will be applied at all. Even in the case of a power failure, this characteristic should be preserved (as long as the filesystem isn't corrupted, etc).<p>
A transaction is started with <a class="el" href="classXapian_1_1WritableDatabase.html#c4d8b73dcc239e57343fa0c876ef8966" title="Begin a transaction.">begin_transaction()</a> and can either be committed by calling <a class="el" href="classXapian_1_1WritableDatabase.html#2c133f9f814d918eec395c64f941ea65" title="Complete the transaction currently in progress.">commit_transaction()</a> or aborted by calling <a class="el" href="classXapian_1_1WritableDatabase.html#b4f8f5967e553afe357dd365bf84b835" title="Abort the transaction currently in progress, discarding the pending modifications...">cancel_transaction()</a>.<p>
By default, a transaction implicitly calls <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> before and after so that the modifications stand and fall without affecting modifications before or after.<p>
The downside of these implicit calls to <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> is that small transactions can harm indexing performance in the same way that explicitly calling <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> frequently can.<p>
If you're applying atomic groups of changes and only wish to ensure that each group is either applied or not applied, then you can prevent the automatic flush before and after the transaction by starting the transaction with begin_transaction(false). However, if cancel_transaction is called (or if commit_transaction isn't called before the <a class="el" href="classXapian_1_1WritableDatabase.html" title="This class provides read/write access to a database.">WritableDatabase</a> object is destroyed) then any changes which were pending before the transaction began will also be discarded.<p>
Transactions aren't currently supported by the <a class="el" href="namespaceXapian_1_1InMemory.html" title="Database factory functions for the inmemory backend.">InMemory</a> backend.<p>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1UnimplementedError.html" title="UnimplementedError indicates an attempt to use an unimplemented feature.">Xapian::UnimplementedError</a></em>&nbsp;</td><td>will be thrown if transactions are not available for this database type.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1InvalidOperationError.html" title="InvalidOperationError indicates the API was used in an invalid way.">Xapian::InvalidOperationError</a></em>&nbsp;</td><td>will be thrown if this is called at an invalid time, such as when a transaction is already in progress. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="2c133f9f814d918eec395c64f941ea65"></a><!-- doxytag: member="Xapian::WritableDatabase::commit_transaction" ref="2c133f9f814d918eec395c64f941ea65" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::commit_transaction           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Complete the transaction currently in progress. 
<p>
If this method completes successfully and this is a flushed transaction, all the database modifications made during the transaction will have been committed to the database.<p>
If an error occurs, an exception will be thrown, and none of the modifications made to the database during the transaction will have been applied to the database.<p>
In all cases the transaction will no longer be in progress.<p>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseError.html" title="DatabaseError indicates some sort of database related error.">Xapian::DatabaseError</a></em>&nbsp;</td><td>will be thrown if a problem occurs while modifying the database.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseCorruptError.html" title="DatabaseCorruptError indicates database corruption was detected.">Xapian::DatabaseCorruptError</a></em>&nbsp;</td><td>will be thrown if the database is in a corrupt state.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1InvalidOperationError.html" title="InvalidOperationError indicates the API was used in an invalid way.">Xapian::InvalidOperationError</a></em>&nbsp;</td><td>will be thrown if a transaction is not currently in progress.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1UnimplementedError.html" title="UnimplementedError indicates an attempt to use an unimplemented feature.">Xapian::UnimplementedError</a></em>&nbsp;</td><td>will be thrown if transactions are not available for this database type. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="b4f8f5967e553afe357dd365bf84b835"></a><!-- doxytag: member="Xapian::WritableDatabase::cancel_transaction" ref="b4f8f5967e553afe357dd365bf84b835" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::cancel_transaction           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Abort the transaction currently in progress, discarding the pending modifications made to the database. 
<p>
If an error occurs in this method, an exception will be thrown, but the transaction will be cancelled anyway.<p>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseError.html" title="DatabaseError indicates some sort of database related error.">Xapian::DatabaseError</a></em>&nbsp;</td><td>will be thrown if a problem occurs while modifying the database.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseCorruptError.html" title="DatabaseCorruptError indicates database corruption was detected.">Xapian::DatabaseCorruptError</a></em>&nbsp;</td><td>will be thrown if the database is in a corrupt state.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1InvalidOperationError.html" title="InvalidOperationError indicates the API was used in an invalid way.">Xapian::InvalidOperationError</a></em>&nbsp;</td><td>will be thrown if a transaction is not currently in progress.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1UnimplementedError.html" title="UnimplementedError indicates an attempt to use an unimplemented feature.">Xapian::UnimplementedError</a></em>&nbsp;</td><td>will be thrown if transactions are not available for this database type. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="367b1a512677b2a66354250c6e90a9e7"></a><!-- doxytag: member="Xapian::WritableDatabase::add_document" ref="367b1a512677b2a66354250c6e90a9e7" args="(const Xapian::Document &amp;document)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceXapian.html#d8d873ad5830cff0b4bbd89d7da45d15">Xapian::docid</a> Xapian::WritableDatabase::add_document           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classXapian_1_1Document.html">Xapian::Document</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>document</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Add a new document to the database. 
<p>
This method adds the specified document to the database, returning a newly allocated document ID. Automatically allocated document IDs come from a per-database monotonically increasing counter, so IDs from deleted documents won't be reused.<p>
If you want to specify the document ID to be used, you should call <a class="el" href="classXapian_1_1WritableDatabase.html#8a206aed75514f5559d51a3dfc1cc625" title="Replace a given document in the database.">replace_document()</a> instead.<p>
Note that changes to the database won't be immediately committed to disk; see <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> for more details.<p>
As with all database modification operations, the effect is atomic: the document will either be fully added, or the document fails to be added and an exception is thrown (possibly at a later time when <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> is called or the database is closed).<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>document</em>&nbsp;</td><td>The new document to be added.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The document ID of the newly added document.</dd></dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseError.html" title="DatabaseError indicates some sort of database related error.">Xapian::DatabaseError</a></em>&nbsp;</td><td>will be thrown if a problem occurs while writing to the database.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseCorruptError.html" title="DatabaseCorruptError indicates database corruption was detected.">Xapian::DatabaseCorruptError</a></em>&nbsp;</td><td>will be thrown if the database is in a corrupt state. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="3a286d6af6894a072bcb8cf208b2fddd"></a><!-- doxytag: member="Xapian::WritableDatabase::delete_document" ref="3a286d6af6894a072bcb8cf208b2fddd" args="(Xapian::docid did)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::delete_document           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceXapian.html#d8d873ad5830cff0b4bbd89d7da45d15">Xapian::docid</a>&nbsp;</td>
          <td class="paramname"> <em>did</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Delete a document from the database. 
<p>
This method removes the document with the specified document ID from the database.<p>
Note that changes to the database won't be immediately committed to disk; see <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> for more details.<p>
As with all database modification operations, the effect is atomic: the document will either be fully removed, or the document fails to be removed and an exception is thrown (possibly at a later time when <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> is called or the database is closed).<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>did</em>&nbsp;</td><td>The document ID of the document to be removed.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseError.html" title="DatabaseError indicates some sort of database related error.">Xapian::DatabaseError</a></em>&nbsp;</td><td>will be thrown if a problem occurs while writing to the database.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseCorruptError.html" title="DatabaseCorruptError indicates database corruption was detected.">Xapian::DatabaseCorruptError</a></em>&nbsp;</td><td>will be thrown if the database is in a corrupt state. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="df08e9e0baaa1245409a1b7a38b3357c"></a><!-- doxytag: member="Xapian::WritableDatabase::delete_document" ref="df08e9e0baaa1245409a1b7a38b3357c" args="(const std::string &amp;unique_term)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::delete_document           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>unique_term</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Delete any documents indexed by a term from the database. 
<p>
This method removes any documents indexed by the specified term from the database.<p>
A major use is for convenience when UIDs from another system are mapped to terms in <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a>, although this method has other uses (for example, you could add a "deletion date" term to documents at index time and use this method to delete all documents due for deletion on a particular date).<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>unique_term</em>&nbsp;</td><td>The term to remove references to.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseError.html" title="DatabaseError indicates some sort of database related error.">Xapian::DatabaseError</a></em>&nbsp;</td><td>will be thrown if a problem occurs while writing to the database.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseCorruptError.html" title="DatabaseCorruptError indicates database corruption was detected.">Xapian::DatabaseCorruptError</a></em>&nbsp;</td><td>will be thrown if the database is in a corrupt state. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="8a206aed75514f5559d51a3dfc1cc625"></a><!-- doxytag: member="Xapian::WritableDatabase::replace_document" ref="8a206aed75514f5559d51a3dfc1cc625" args="(Xapian::docid did, const Xapian::Document &amp;document)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::replace_document           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceXapian.html#d8d873ad5830cff0b4bbd89d7da45d15">Xapian::docid</a>&nbsp;</td>
          <td class="paramname"> <em>did</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classXapian_1_1Document.html">Xapian::Document</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>document</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Replace a given document in the database. 
<p>
This method replaces the document with the specified document ID. If document ID <em>did</em> isn't currently used, the document will be added with document ID <em>did</em>.<p>
The monotonic counter used for automatically allocating document IDs is increased so that the next automatically allocated document ID will be did + 1. Be aware that if you use this method to specify a high document ID for a new document, and also use <a class="el" href="classXapian_1_1WritableDatabase.html#367b1a512677b2a66354250c6e90a9e7" title="Add a new document to the database.">WritableDatabase::add_document()</a>, <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> may get to a state where this counter wraps around and will be unable to automatically allocate document IDs!<p>
Note that changes to the database won't be immediately committed to disk; see <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> for more details.<p>
As with all database modification operations, the effect is atomic: the document will either be fully replaced, or the document fails to be replaced and an exception is thrown (possibly at a later time when <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> is called or the database is closed).<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>did</em>&nbsp;</td><td>The document ID of the document to be replaced. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>document</em>&nbsp;</td><td>The new document.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseError.html" title="DatabaseError indicates some sort of database related error.">Xapian::DatabaseError</a></em>&nbsp;</td><td>will be thrown if a problem occurs while writing to the database.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseCorruptError.html" title="DatabaseCorruptError indicates database corruption was detected.">Xapian::DatabaseCorruptError</a></em>&nbsp;</td><td>will be thrown if the database is in a corrupt state. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="c4c6d54060301ffc0d99bb1622443e00"></a><!-- doxytag: member="Xapian::WritableDatabase::replace_document" ref="c4c6d54060301ffc0d99bb1622443e00" args="(const std::string &amp;unique_term, const Xapian::Document &amp;document)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceXapian.html#d8d873ad5830cff0b4bbd89d7da45d15">Xapian::docid</a> Xapian::WritableDatabase::replace_document           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>unique_term</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classXapian_1_1Document.html">Xapian::Document</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>document</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Replace any documents matching a term. 
<p>
This method replaces any documents indexed by the specified term with the specified document. If any documents are indexed by the term, the lowest document ID will be used for the document, otherwise a new document ID will be generated as for add_document.<p>
One common use is to allow UIDs from another system to easily be mapped to terms in <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a>. Note that this method doesn't automatically add unique_term as a term, so you'll need to call document.add_term(unique_term) first when using <a class="el" href="classXapian_1_1WritableDatabase.html#8a206aed75514f5559d51a3dfc1cc625" title="Replace a given document in the database.">replace_document()</a> in this way.<p>
Another possible use is to allow groups of documents to be marked for later deletion - for example, you could add a "deletion date" term to documents at index time and use this method to easily and efficiently delete all documents due for deletion on a particular date.<p>
Note that changes to the database won't be immediately committed to disk; see <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> for more details.<p>
As with all database modification operations, the effect is atomic: the document(s) will either be fully replaced, or the document(s) fail to be replaced and an exception is thrown (possibly at a later time when <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> is called or the database is closed).<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>unique_term</em>&nbsp;</td><td>The "unique" term. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>document</em>&nbsp;</td><td>The new document.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The document ID that document was given.</dd></dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseError.html" title="DatabaseError indicates some sort of database related error.">Xapian::DatabaseError</a></em>&nbsp;</td><td>will be thrown if a problem occurs while writing to the database.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseCorruptError.html" title="DatabaseCorruptError indicates database corruption was detected.">Xapian::DatabaseCorruptError</a></em>&nbsp;</td><td>will be thrown if the database is in a corrupt state. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="ba118fe18b5393049e6ae6260f5b957d"></a><!-- doxytag: member="Xapian::WritableDatabase::add_spelling" ref="ba118fe18b5393049e6ae6260f5b957d" args="(const std::string &amp;word, Xapian::termcount freqinc=1) const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::add_spelling           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>word</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceXapian.html#3261017447607738e49eae6a2a4f5eec">Xapian::termcount</a>&nbsp;</td>
          <td class="paramname"> <em>freqinc</em> = <code>1</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Add a word to the spelling dictionary. 
<p>
If the word is already present, its frequency is increased.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>word</em>&nbsp;</td><td>The word to add. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>freqinc</em>&nbsp;</td><td>How much to increase its frequency by (default 1). </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="d73fcc0a46a100963dfe4b0ec9856620"></a><!-- doxytag: member="Xapian::WritableDatabase::remove_spelling" ref="d73fcc0a46a100963dfe4b0ec9856620" args="(const std::string &amp;word, Xapian::termcount freqdec=1) const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::remove_spelling           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>word</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceXapian.html#3261017447607738e49eae6a2a4f5eec">Xapian::termcount</a>&nbsp;</td>
          <td class="paramname"> <em>freqdec</em> = <code>1</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Remove a word from the spelling dictionary. 
<p>
The word's frequency is decreased, and if would become zero or less then the word is removed completely.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>word</em>&nbsp;</td><td>The word to remove. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>freqdec</em>&nbsp;</td><td>How much to decrease its frequency by (default 1). </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="ae0f927455b1eacbf6d17a84515c11cc"></a><!-- doxytag: member="Xapian::WritableDatabase::add_synonym" ref="ae0f927455b1eacbf6d17a84515c11cc" args="(const std::string &amp;term, const std::string &amp;synonym) const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::add_synonym           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>term</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>synonym</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Add a synonym for a term. 
<p>
If <em>synonym</em> is already a synonym for <em>term</em>, then no action is taken. 
</div>
</div><p>
<a class="anchor" name="90af693a4a8d1f9ccb616def02881fef"></a><!-- doxytag: member="Xapian::WritableDatabase::remove_synonym" ref="90af693a4a8d1f9ccb616def02881fef" args="(const std::string &amp;term, const std::string &amp;synonym) const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::remove_synonym           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>term</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>synonym</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Remove a synonym for a term. 
<p>
If <em>synonym</em> isn't a synonym for <em>term</em>, then no action is taken. 
</div>
</div><p>
<a class="anchor" name="d6d0ed75832ab64c0cc382fd82db4b7c"></a><!-- doxytag: member="Xapian::WritableDatabase::clear_synonyms" ref="d6d0ed75832ab64c0cc382fd82db4b7c" args="(const std::string &amp;term) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::clear_synonyms           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>term</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Remove all synonyms for a term. 
<p>
If <em>term</em> has no synonyms, no action is taken. 
</div>
</div><p>
<a class="anchor" name="4a8d53e528bda6cee8e507b95f5c0b31"></a><!-- doxytag: member="Xapian::WritableDatabase::set_metadata" ref="4a8d53e528bda6cee8e507b95f5c0b31" args="(const std::string &amp;key, const std::string &amp;value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::WritableDatabase::set_metadata           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>value</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the user-specified metadata associated with a given key. 
<p>
This method sets the metadata value associated with a given key. If there is already a metadata value stored in the database with the same key, the old value is replaced. If you want to delete an existing item of metadata, just set its value to the empty string.<p>
User-specified metadata allows you to store arbitrary information in the form of (key,tag) pairs.<p>
There's no hard limit on the number of metadata items, or the size of the metadata values. Metadata keys have a limited length, which depends on the backend. We recommend limiting them to 200 bytes. Empty keys are not valid, and specifying one will cause an exception.<p>
Metadata modifications are committed to disk in the same way as modifications to the documents in the database are: i.e., modifications are atomic, and won't be committed to disk immediately (see <a class="el" href="classXapian_1_1WritableDatabase.html#d0077acafa9485c97b73b8726c375732" title="Commit any pending modifications made to the database.">flush()</a> for more details). This allows metadata to be used to link databases with versioned external resources by storing the appropriate version number in a metadata item.<p>
You can also use the metadata to store arbitrary extra information associated with terms, documents, or postings by encoding the termname and/or document id into the metadata key.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>The key of the metadata item to set.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>value</em>&nbsp;</td><td>The value of the metadata item to set.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseError.html" title="DatabaseError indicates some sort of database related error.">Xapian::DatabaseError</a></em>&nbsp;</td><td>will be thrown if a problem occurs while writing to the database.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1DatabaseCorruptError.html" title="DatabaseCorruptError indicates database corruption was detected.">Xapian::DatabaseCorruptError</a></em>&nbsp;</td><td>will be thrown if the database is in a corrupt state.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1InvalidArgumentError.html" title="InvalidArgumentError indicates an invalid parameter value was passed to the API.">Xapian::InvalidArgumentError</a></em>&nbsp;</td><td>will be thrown if the key supplied is empty.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classXapian_1_1UnimplementedError.html" title="UnimplementedError indicates an attempt to use an unimplemented feature.">Xapian::UnimplementedError</a></em>&nbsp;</td><td>will be thrown if the database backend in use doesn't support user-specified metadata. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="24f364f0748df4ef2eedf31bd3bab167"></a><!-- doxytag: member="Xapian::WritableDatabase::get_description" ref="24f364f0748df4ef2eedf31bd3bab167" args="() const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Xapian::WritableDatabase::get_description           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return a string describing this object. 
<p>

<p>
Reimplemented from <a class="el" href="classXapian_1_1Database.html#44d59729206e5b39b73a90f5423c2b22">Xapian::Database</a>.
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>xapian/<a class="el" href="database_8h.html">database.h</a></ul>
<hr>
<address><small>
Documentation for Xapian (version 1.0.21).<br>
Generated on 18 Jun 2010 by
<a href="http://www.doxygen.org/">Doxygen 1.5.2</a>.
</small></address>
</body>
</html>