| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 5 |
<meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 6 |
<meta name="generator" content="Doxygen 1.15.0"/> |
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 8 |
<title>Xapian: API Documentation: Xapian::Document Class Reference</title> |
| 9 |
<link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 10 |
<script type="text/javascript" src="jquery.js"></script> |
| 11 |
<script type="text/javascript" src="dynsections.js"></script> |
| 12 |
<link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 13 |
</head> |
| 14 |
<body> |
| 15 |
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 16 |
<div id="titlearea"> |
| 17 |
<table cellspacing="0" cellpadding="0"> |
| 18 |
<tbody> |
| 19 |
<tr style="height: 56px;"> |
| 20 |
<td id="projectalign" style="padding-left: 0.5em;"> |
| 21 |
<div id="projectname">xapian-core |
| 22 |
 <span id="projectnumber">1.4.31</span> |
| 23 |
</div> |
| 24 |
</td> |
| 25 |
</tr> |
| 26 |
</tbody> |
| 27 |
</table> |
| 28 |
</div> |
| 29 |
<!-- end header part --> |
| 30 |
<!-- Generated by Doxygen 1.15.0 --> |
| 31 |
<script type="text/javascript"> |
| 32 |
$(function() { codefold.init(); }); |
| 33 |
</script> |
| 34 |
<script type="text/javascript" src="menudata.js"></script> |
| 35 |
<script type="text/javascript" src="menu.js"></script> |
| 36 |
<script type="text/javascript"> |
| 37 |
$(function() { |
| 38 |
initMenu('',false,false,'search.php','Search',false); |
| 39 |
}); |
| 40 |
</script> |
| 41 |
<div id="main-nav"></div> |
| 42 |
<div id="nav-path" class="navpath"> |
| 43 |
<ul> |
| 44 |
<li class="navelem"><a href="namespaceXapian.html">Xapian</a></li><li class="navelem"><a href="classXapian_1_1Document.html">Document</a></li> </ul> |
| 45 |
</div> |
| 46 |
</div><!-- top --> |
| 47 |
<div id="doc-content"> |
| 48 |
<div class="header"> |
| 49 |
<div class="summary"> |
| 50 |
<a href="#pub-methods">Public Member Functions</a> | |
| 51 |
<a href="#pub-static-methods">Static Public Member Functions</a> | |
| 52 |
<a href="classXapian_1_1Document-members.html">List of all members</a> </div> |
| 53 |
<div class="headertitle"><div class="title">Xapian::Document Class Reference</div></div> |
| 54 |
</div><!--header--> |
| 55 |
<div class="contents"> |
| 56 |
|
| 57 |
<p>A handle representing a document in a <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> database. |
| 58 |
<a href="#details">More...</a></p> |
| 59 |
|
| 60 |
<p><code>#include <document.h></code></p> |
| 61 |
<table class="memberdecls"> |
| 62 |
<tr class="heading"><td colspan="2"><h2 id="header-pub-methods" class="groupheader"><a id="pub-methods" name="pub-methods"></a> |
| 63 |
Public Member Functions</h2></td></tr> |
| 64 |
<tr class="memitem:a27316171adc74325e42d5e88b004e189" id="r_a27316171adc74325e42d5e88b004e189"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#a27316171adc74325e42d5e88b004e189">Document</a> (const Document &other)</td></tr> |
| 65 |
<tr class="memdesc:a27316171adc74325e42d5e88b004e189"><td class="mdescLeft"> </td><td class="mdescRight">Copying is allowed. <br /></td></tr> |
| 66 |
<tr class="memitem:a470144b154e9a7ec40b0875a8d636b9b" id="r_a470144b154e9a7ec40b0875a8d636b9b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a470144b154e9a7ec40b0875a8d636b9b">operator=</a> (const Document &other)</td></tr> |
| 67 |
<tr class="memdesc:a470144b154e9a7ec40b0875a8d636b9b"><td class="mdescLeft"> </td><td class="mdescRight">Assignment is allowed. <br /></td></tr> |
| 68 |
<tr class="memitem:ae75d6c6a48b1cfed5b85189cb766531b" id="r_ae75d6c6a48b1cfed5b85189cb766531b"><td class="memItemLeft" align="right" valign="top"><a id="ae75d6c6a48b1cfed5b85189cb766531b" name="ae75d6c6a48b1cfed5b85189cb766531b"></a> |
| 69 |
 </td><td class="memItemRight" valign="bottom"><b>Document</b> ()</td></tr> |
| 70 |
<tr class="memdesc:ae75d6c6a48b1cfed5b85189cb766531b"><td class="mdescLeft"> </td><td class="mdescRight">Make a new empty <a class="el" href="classXapian_1_1Document.html" title="A handle representing a document in a Xapian database.">Document</a>. <br /></td></tr> |
| 71 |
<tr class="memitem:a943a905545bd862dbc7281e6d66e5ee4" id="r_a943a905545bd862dbc7281e6d66e5ee4"><td class="memItemLeft" align="right" valign="top"><a id="a943a905545bd862dbc7281e6d66e5ee4" name="a943a905545bd862dbc7281e6d66e5ee4"></a> |
| 72 |
 </td><td class="memItemRight" valign="bottom"><b>~Document</b> ()</td></tr> |
| 73 |
<tr class="memdesc:a943a905545bd862dbc7281e6d66e5ee4"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <br /></td></tr> |
| 74 |
<tr class="memitem:a958c6063c67eae8b78242baa461b6389" id="r_a958c6063c67eae8b78242baa461b6389"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="#a958c6063c67eae8b78242baa461b6389">get_value</a> (<a class="el" href="namespaceXapian.html#a94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> slot) const</td></tr> |
| 75 |
<tr class="memdesc:a958c6063c67eae8b78242baa461b6389"><td class="mdescLeft"> </td><td class="mdescRight">Get value by number. <br /></td></tr> |
| 76 |
<tr class="memitem:a12857fccd3448ec1db91311c16d67f6c" id="r_a12857fccd3448ec1db91311c16d67f6c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a12857fccd3448ec1db91311c16d67f6c">add_value</a> (<a class="el" href="namespaceXapian.html#a94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> slot, const std::string &value)</td></tr> |
| 77 |
<tr class="memdesc:a12857fccd3448ec1db91311c16d67f6c"><td class="mdescLeft"> </td><td class="mdescRight">Add a new value. <br /></td></tr> |
| 78 |
<tr class="memitem:a6ffd0e3d1beb8f047b3158a5e5aa41d4" id="r_a6ffd0e3d1beb8f047b3158a5e5aa41d4"><td class="memItemLeft" align="right" valign="top"><a id="a6ffd0e3d1beb8f047b3158a5e5aa41d4" name="a6ffd0e3d1beb8f047b3158a5e5aa41d4"></a> |
| 79 |
void </td><td class="memItemRight" valign="bottom"><b>remove_value</b> (<a class="el" href="namespaceXapian.html#a94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> slot)</td></tr> |
| 80 |
<tr class="memdesc:a6ffd0e3d1beb8f047b3158a5e5aa41d4"><td class="mdescLeft"> </td><td class="mdescRight">Remove any value with the given number. <br /></td></tr> |
| 81 |
<tr class="memitem:a99f8cb1deeab46df42fed52ea4f55eb9" id="r_a99f8cb1deeab46df42fed52ea4f55eb9"><td class="memItemLeft" align="right" valign="top"><a id="a99f8cb1deeab46df42fed52ea4f55eb9" name="a99f8cb1deeab46df42fed52ea4f55eb9"></a> |
| 82 |
void </td><td class="memItemRight" valign="bottom"><b>clear_values</b> ()</td></tr> |
| 83 |
<tr class="memdesc:a99f8cb1deeab46df42fed52ea4f55eb9"><td class="mdescLeft"> </td><td class="mdescRight">Remove all values associated with the document. <br /></td></tr> |
| 84 |
<tr class="memitem:ac72a216225acb299b73c1f6c8800ddce" id="r_ac72a216225acb299b73c1f6c8800ddce"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="#ac72a216225acb299b73c1f6c8800ddce">get_data</a> () const</td></tr> |
| 85 |
<tr class="memdesc:ac72a216225acb299b73c1f6c8800ddce"><td class="mdescLeft"> </td><td class="mdescRight">Get data stored in the document. <br /></td></tr> |
| 86 |
<tr class="memitem:ab1b0da2e7c76acd754f29a52e14f89ae" id="r_ab1b0da2e7c76acd754f29a52e14f89ae"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#ab1b0da2e7c76acd754f29a52e14f89ae">set_data</a> (const std::string &data)</td></tr> |
| 87 |
<tr class="memdesc:ab1b0da2e7c76acd754f29a52e14f89ae"><td class="mdescLeft"> </td><td class="mdescRight">Set data stored in the document. <br /></td></tr> |
| 88 |
<tr class="memitem:a161943bb133fea0da4a21fa37621764b" id="r_a161943bb133fea0da4a21fa37621764b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a161943bb133fea0da4a21fa37621764b">add_posting</a> (const std::string &tname, <a class="el" href="namespaceXapian.html#ae1faeb9bd109b4d78a02d4b5f7b123ed">Xapian::termpos</a> tpos, <a class="el" href="namespaceXapian.html#a4464380f6fa0055b5f26b8d03ae170e2">Xapian::termcount</a> wdfinc=1)</td></tr> |
| 89 |
<tr class="memdesc:a161943bb133fea0da4a21fa37621764b"><td class="mdescLeft"> </td><td class="mdescRight">Add an occurrence of a term at a particular position. <br /></td></tr> |
| 90 |
<tr class="memitem:a730bb59dda98f19c61fe67360f0adb3a" id="r_a730bb59dda98f19c61fe67360f0adb3a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a730bb59dda98f19c61fe67360f0adb3a">add_term</a> (const std::string &tname, <a class="el" href="namespaceXapian.html#a4464380f6fa0055b5f26b8d03ae170e2">Xapian::termcount</a> wdfinc=1)</td></tr> |
| 91 |
<tr class="memdesc:a730bb59dda98f19c61fe67360f0adb3a"><td class="mdescLeft"> </td><td class="mdescRight">Add a term to the document, without positional information. <br /></td></tr> |
| 92 |
<tr class="memitem:a5dcc3df00ccb9ab3a8dee594f603d299" id="r_a5dcc3df00ccb9ab3a8dee594f603d299"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a5dcc3df00ccb9ab3a8dee594f603d299">add_boolean_term</a> (const std::string &term)</td></tr> |
| 93 |
<tr class="memdesc:a5dcc3df00ccb9ab3a8dee594f603d299"><td class="mdescLeft"> </td><td class="mdescRight">Add a boolean filter term to the document. <br /></td></tr> |
| 94 |
<tr class="memitem:a11eec629737e496a7077b87f763967a5" id="r_a11eec629737e496a7077b87f763967a5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a11eec629737e496a7077b87f763967a5">remove_posting</a> (const std::string &tname, <a class="el" href="namespaceXapian.html#ae1faeb9bd109b4d78a02d4b5f7b123ed">Xapian::termpos</a> tpos, <a class="el" href="namespaceXapian.html#a4464380f6fa0055b5f26b8d03ae170e2">Xapian::termcount</a> wdfdec=1)</td></tr> |
| 95 |
<tr class="memdesc:a11eec629737e496a7077b87f763967a5"><td class="mdescLeft"> </td><td class="mdescRight">Remove a posting of a term from the document. <br /></td></tr> |
| 96 |
<tr class="memitem:a40ef21aa8a3664612bf1792b9fbad207" id="r_a40ef21aa8a3664612bf1792b9fbad207"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceXapian.html#ae1faeb9bd109b4d78a02d4b5f7b123ed">Xapian::termpos</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#a40ef21aa8a3664612bf1792b9fbad207">remove_postings</a> (const std::string &term, <a class="el" href="namespaceXapian.html#ae1faeb9bd109b4d78a02d4b5f7b123ed">Xapian::termpos</a> term_pos_first, <a class="el" href="namespaceXapian.html#ae1faeb9bd109b4d78a02d4b5f7b123ed">Xapian::termpos</a> term_pos_last, <a class="el" href="namespaceXapian.html#a4464380f6fa0055b5f26b8d03ae170e2">Xapian::termcount</a> wdf_dec=1)</td></tr> |
| 97 |
<tr class="memdesc:a40ef21aa8a3664612bf1792b9fbad207"><td class="mdescLeft"> </td><td class="mdescRight">Remove a range of postings for a term. <br /></td></tr> |
| 98 |
<tr class="memitem:a01e5b7bf54fdee77a978c3b5f1b007ba" id="r_a01e5b7bf54fdee77a978c3b5f1b007ba"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a01e5b7bf54fdee77a978c3b5f1b007ba">remove_term</a> (const std::string &tname)</td></tr> |
| 99 |
<tr class="memdesc:a01e5b7bf54fdee77a978c3b5f1b007ba"><td class="mdescLeft"> </td><td class="mdescRight">Remove a term and all postings associated with it. <br /></td></tr> |
| 100 |
<tr class="memitem:aa0bd9e001ffd29b0678938522d4e37e5" id="r_aa0bd9e001ffd29b0678938522d4e37e5"><td class="memItemLeft" align="right" valign="top"><a id="aa0bd9e001ffd29b0678938522d4e37e5" name="aa0bd9e001ffd29b0678938522d4e37e5"></a> |
| 101 |
void </td><td class="memItemRight" valign="bottom"><b>clear_terms</b> ()</td></tr> |
| 102 |
<tr class="memdesc:aa0bd9e001ffd29b0678938522d4e37e5"><td class="mdescLeft"> </td><td class="mdescRight">Remove all terms (and postings) from the document. <br /></td></tr> |
| 103 |
<tr class="memitem:a79d8d9533db25fc468c122515eaf4a54" id="r_a79d8d9533db25fc468c122515eaf4a54"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceXapian.html#a4464380f6fa0055b5f26b8d03ae170e2">Xapian::termcount</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#a79d8d9533db25fc468c122515eaf4a54">termlist_count</a> () const</td></tr> |
| 104 |
<tr class="memdesc:a79d8d9533db25fc468c122515eaf4a54"><td class="mdescLeft"> </td><td class="mdescRight">The length of the termlist - i.e. <br /></td></tr> |
| 105 |
<tr class="memitem:a868f19157a88ecaf1131923fdd963d60" id="r_a868f19157a88ecaf1131923fdd963d60"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classXapian_1_1TermIterator.html">TermIterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#a868f19157a88ecaf1131923fdd963d60">termlist_begin</a> () const</td></tr> |
| 106 |
<tr class="memdesc:a868f19157a88ecaf1131923fdd963d60"><td class="mdescLeft"> </td><td class="mdescRight">Start iterating the terms in this document. <br /></td></tr> |
| 107 |
<tr class="memitem:a6b7fbca3f6dcb61a65e70f7744fc9c2d" id="r_a6b7fbca3f6dcb61a65e70f7744fc9c2d"><td class="memItemLeft" align="right" valign="top"><a id="a6b7fbca3f6dcb61a65e70f7744fc9c2d" name="a6b7fbca3f6dcb61a65e70f7744fc9c2d"></a> |
| 108 |
<a class="el" href="classXapian_1_1TermIterator.html">TermIterator</a> </td><td class="memItemRight" valign="bottom"><b>termlist_end</b> () const</td></tr> |
| 109 |
<tr class="memdesc:a6b7fbca3f6dcb61a65e70f7744fc9c2d"><td class="mdescLeft"> </td><td class="mdescRight">Equivalent end iterator for <a class="el" href="#a868f19157a88ecaf1131923fdd963d60" title="Start iterating the terms in this document.">termlist_begin()</a>. <br /></td></tr> |
| 110 |
<tr class="memitem:ae88f9d58434df65c24b7eed3aecbf7ee" id="r_ae88f9d58434df65c24b7eed3aecbf7ee"><td class="memItemLeft" align="right" valign="top"><a id="ae88f9d58434df65c24b7eed3aecbf7ee" name="ae88f9d58434df65c24b7eed3aecbf7ee"></a> |
| 111 |
<a class="el" href="namespaceXapian.html#a4464380f6fa0055b5f26b8d03ae170e2">Xapian::termcount</a> </td><td class="memItemRight" valign="bottom"><b>values_count</b> () const</td></tr> |
| 112 |
<tr class="memdesc:ae88f9d58434df65c24b7eed3aecbf7ee"><td class="mdescLeft"> </td><td class="mdescRight">Count the values in this document. <br /></td></tr> |
| 113 |
<tr class="memitem:a55a456a7ed63155058353a9882c4fa15" id="r_a55a456a7ed63155058353a9882c4fa15"><td class="memItemLeft" align="right" valign="top"><a id="a55a456a7ed63155058353a9882c4fa15" name="a55a456a7ed63155058353a9882c4fa15"></a> |
| 114 |
<a class="el" href="classXapian_1_1ValueIterator.html">ValueIterator</a> </td><td class="memItemRight" valign="bottom"><b>values_begin</b> () const</td></tr> |
| 115 |
<tr class="memdesc:a55a456a7ed63155058353a9882c4fa15"><td class="mdescLeft"> </td><td class="mdescRight">Iterator for the values in this document. <br /></td></tr> |
| 116 |
<tr class="memitem:a715896b185c6f9c7b9075e3dde46ab03" id="r_a715896b185c6f9c7b9075e3dde46ab03"><td class="memItemLeft" align="right" valign="top"><a id="a715896b185c6f9c7b9075e3dde46ab03" name="a715896b185c6f9c7b9075e3dde46ab03"></a> |
| 117 |
<a class="el" href="classXapian_1_1ValueIterator.html">ValueIterator</a> </td><td class="memItemRight" valign="bottom"><b>values_end</b> () const</td></tr> |
| 118 |
<tr class="memdesc:a715896b185c6f9c7b9075e3dde46ab03"><td class="mdescLeft"> </td><td class="mdescRight">Equivalent end iterator for <a class="el" href="#a55a456a7ed63155058353a9882c4fa15" title="Iterator for the values in this document.">values_begin()</a>. <br /></td></tr> |
| 119 |
<tr class="memitem:a5920609db7fb6f27001b102aee5a47bd" id="r_a5920609db7fb6f27001b102aee5a47bd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceXapian.html#ad8f7a78bc920532b7d2baa3281b33e2f">docid</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#a5920609db7fb6f27001b102aee5a47bd">get_docid</a> () const</td></tr> |
| 120 |
<tr class="memdesc:a5920609db7fb6f27001b102aee5a47bd"><td class="mdescLeft"> </td><td class="mdescRight">Get the document id which is associated with this document (if any). <br /></td></tr> |
| 121 |
<tr class="memitem:ad46249a090c08abf04f5cb6ae8fdea1f" id="r_ad46249a090c08abf04f5cb6ae8fdea1f"><td class="memItemLeft" align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="#ad46249a090c08abf04f5cb6ae8fdea1f">serialise</a> () const</td></tr> |
| 122 |
<tr class="memdesc:ad46249a090c08abf04f5cb6ae8fdea1f"><td class="mdescLeft"> </td><td class="mdescRight">Serialise document into a string. <br /></td></tr> |
| 123 |
<tr class="memitem:a0667045d22657781b4881fcb141f2be6" id="r_a0667045d22657781b4881fcb141f2be6"><td class="memItemLeft" align="right" valign="top"><a id="a0667045d22657781b4881fcb141f2be6" name="a0667045d22657781b4881fcb141f2be6"></a> |
| 124 |
std::string </td><td class="memItemRight" valign="bottom"><b>get_description</b> () const</td></tr> |
| 125 |
<tr class="memdesc:a0667045d22657781b4881fcb141f2be6"><td class="mdescLeft"> </td><td class="mdescRight">Return a string describing this object. <br /></td></tr> |
| 126 |
</table><table class="memberdecls"> |
| 127 |
<tr class="heading"><td colspan="2"><h2 id="header-pub-static-methods" class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a> |
| 128 |
Static Public Member Functions</h2></td></tr> |
| 129 |
<tr class="memitem:a79a48573ae03d9a481df462cd9831b8e" id="r_a79a48573ae03d9a481df462cd9831b8e"><td class="memItemLeft" align="right" valign="top"><a id="a79a48573ae03d9a481df462cd9831b8e" name="a79a48573ae03d9a481df462cd9831b8e"></a> |
| 130 |
static Document </td><td class="memItemRight" valign="bottom"><b>unserialise</b> (const std::string &serialised)</td></tr> |
| 131 |
<tr class="memdesc:a79a48573ae03d9a481df462cd9831b8e"><td class="mdescLeft"> </td><td class="mdescRight">Unserialise a document from a string produced by <a class="el" href="#ad46249a090c08abf04f5cb6ae8fdea1f" title="Serialise document into a string.">serialise()</a>. <br /></td></tr> |
| 132 |
</table> |
| 133 |
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2> |
| 134 |
<div class="textblock"><p>A handle representing a document in a <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> database. </p> |
| 135 |
<p>The <a class="el" href="classXapian_1_1Document.html" title="A handle representing a document in a Xapian database.">Document</a> class fetches information from the database lazily. Usually this behaviour isn't visible to users (except for the speed benefits), but if the document in the database is modified or deleted, then preexisting <a class="el" href="classXapian_1_1Document.html" title="A handle representing a document in a Xapian database.">Document</a> objects may return the old or new versions of data (or throw <a class="el" href="classXapian_1_1DocNotFoundError.html" title="Indicates an attempt to access a document not present in the database.">Xapian::DocNotFoundError</a> in the case of deletion).</p> |
| 136 |
<p>Since <a class="el" href="classXapian_1_1Database.html" title="This class is used to access a database, or a group of databases.">Database</a> objects work on a snapshot of the database's state, the situation above can only happen with a <a class="el" href="classXapian_1_1WritableDatabase.html" title="This class provides read/write access to a database.">WritableDatabase</a> object, or if you call <a class="el" href="classXapian_1_1Database.html#af316aa13ee123e2af75f4b44e1f23db9" title="Re-open the database.">Database::reopen()</a> on 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> object.</p> |
| 137 |
<p>We recommend you avoid designs where this behaviour is an issue, but if you need a way to make a non-lazy version of a <a class="el" href="classXapian_1_1Document.html" title="A handle representing a document in a Xapian database.">Document</a> object, you can do this like so: </p><pre class="fragment">doc = Xapian::Document::unserialise(doc.serialise()); |
| 138 |
</pre> </div><a name="doc-constructors" id="doc-constructors"></a><h2 id="header-doc-constructors" class="groupheader">Constructor & Destructor Documentation</h2> |
| 139 |
<a id="a27316171adc74325e42d5e88b004e189" name="a27316171adc74325e42d5e88b004e189"></a> |
| 140 |
<h2 class="memtitle"><span class="permalink"><a href="#a27316171adc74325e42d5e88b004e189">◆ </a></span>Document()</h2> |
| 141 |
|
| 142 |
<div class="memitem"> |
| 143 |
<div class="memproto"> |
| 144 |
<table class="memname"> |
| 145 |
<tr> |
| 146 |
<td class="memname">Xapian::Document::Document </td> |
| 147 |
<td>(</td> |
| 148 |
<td class="paramtype">const Document &</td> <td class="paramname"><span class="paramname"><em>other</em></span></td><td>)</td> |
| 149 |
<td></td> |
| 150 |
</tr> |
| 151 |
</table> |
| 152 |
</div><div class="memdoc"> |
| 153 |
|
| 154 |
<p>Copying is allowed. </p> |
| 155 |
<p>The internals are reference counted, so copying is cheap.</p> |
| 156 |
<dl class="params"><dt>Parameters</dt><dd> |
| 157 |
<table class="params"> |
| 158 |
<tr><td class="paramname">other</td><td>The object to copy. </td></tr> |
| 159 |
</table> |
| 160 |
</dd> |
| 161 |
</dl> |
| 162 |
|
| 163 |
</div> |
| 164 |
</div> |
| 165 |
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Member Function Documentation</h2> |
| 166 |
<a id="a5dcc3df00ccb9ab3a8dee594f603d299" name="a5dcc3df00ccb9ab3a8dee594f603d299"></a> |
| 167 |
<h2 class="memtitle"><span class="permalink"><a href="#a5dcc3df00ccb9ab3a8dee594f603d299">◆ </a></span>add_boolean_term()</h2> |
| 168 |
|
| 169 |
<div class="memitem"> |
| 170 |
<div class="memproto"> |
| 171 |
<table class="mlabels"> |
| 172 |
<tr> |
| 173 |
<td class="mlabels-left"> |
| 174 |
<table class="memname"> |
| 175 |
<tr> |
| 176 |
<td class="memname">void Xapian::Document::add_boolean_term </td> |
| 177 |
<td>(</td> |
| 178 |
<td class="paramtype">const std::string &</td> <td class="paramname"><span class="paramname"><em>term</em></span></td><td>)</td> |
| 179 |
<td></td> |
| 180 |
</tr> |
| 181 |
</table> |
| 182 |
</td> |
| 183 |
<td class="mlabels-right"> |
| 184 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 185 |
</tr> |
| 186 |
</table> |
| 187 |
</div><div class="memdoc"> |
| 188 |
|
| 189 |
<p>Add a boolean filter term to the document. </p> |
| 190 |
<p>This method adds <em class="arg">term</em> to the document with wdf of 0 - this is generally what you want for a term used for boolean filtering as the wdf of such terms is ignored, and it doesn't make sense for them to contribute to the document's length.</p> |
| 191 |
<p>If the specified term already indexes this document, this method has no effect.</p> |
| 192 |
<p>It is exactly the same as add_term(term, 0).</p> |
| 193 |
<p>This method was added in <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> 1.0.18.</p> |
| 194 |
<dl class="params"><dt>Parameters</dt><dd> |
| 195 |
<table class="params"> |
| 196 |
<tr><td class="paramname">term</td><td>The term to add. </td></tr> |
| 197 |
</table> |
| 198 |
</dd> |
| 199 |
</dl> |
| 200 |
|
| 201 |
<p class="reference">References <a class="el" href="#a730bb59dda98f19c61fe67360f0adb3a">add_term()</a>.</p> |
| 202 |
|
| 203 |
</div> |
| 204 |
</div> |
| 205 |
<a id="a161943bb133fea0da4a21fa37621764b" name="a161943bb133fea0da4a21fa37621764b"></a> |
| 206 |
<h2 class="memtitle"><span class="permalink"><a href="#a161943bb133fea0da4a21fa37621764b">◆ </a></span>add_posting()</h2> |
| 207 |
|
| 208 |
<div class="memitem"> |
| 209 |
<div class="memproto"> |
| 210 |
<table class="memname"> |
| 211 |
<tr> |
| 212 |
<td class="memname">void Xapian::Document::add_posting </td> |
| 213 |
<td>(</td> |
| 214 |
<td class="paramtype">const std::string &</td> <td class="paramname"><span class="paramname"><em>tname</em></span>, </td> |
| 215 |
</tr> |
| 216 |
<tr> |
| 217 |
<td class="paramkey"></td> |
| 218 |
<td></td> |
| 219 |
<td class="paramtype"><a class="el" href="namespaceXapian.html#ae1faeb9bd109b4d78a02d4b5f7b123ed">Xapian::termpos</a></td> <td class="paramname"><span class="paramname"><em>tpos</em></span>, </td> |
| 220 |
</tr> |
| 221 |
<tr> |
| 222 |
<td class="paramkey"></td> |
| 223 |
<td></td> |
| 224 |
<td class="paramtype"><a class="el" href="namespaceXapian.html#a4464380f6fa0055b5f26b8d03ae170e2">Xapian::termcount</a></td> <td class="paramname"><span class="paramname"><em>wdfinc</em></span><span class="paramdefsep"> = </span><span class="paramdefval">1</span> )</td> |
| 225 |
</tr> |
| 226 |
</table> |
| 227 |
</div><div class="memdoc"> |
| 228 |
|
| 229 |
<p>Add an occurrence of a term at a particular position. </p> |
| 230 |
<p>Multiple occurrences of the term at the same position are represented only once in the positional information, but do increase the wdf.</p> |
| 231 |
<p>If the term is not already in the document, it will be added to it.</p> |
| 232 |
<dl class="params"><dt>Parameters</dt><dd> |
| 233 |
<table class="params"> |
| 234 |
<tr><td class="paramname">tname</td><td>The name of the term. </td></tr> |
| 235 |
<tr><td class="paramname">tpos</td><td>The position of the term. </td></tr> |
| 236 |
<tr><td class="paramname">wdfinc</td><td>The increment that will be applied to the wdf for this term. </td></tr> |
| 237 |
</table> |
| 238 |
</dd> |
| 239 |
</dl> |
| 240 |
|
| 241 |
</div> |
| 242 |
</div> |
| 243 |
<a id="a730bb59dda98f19c61fe67360f0adb3a" name="a730bb59dda98f19c61fe67360f0adb3a"></a> |
| 244 |
<h2 class="memtitle"><span class="permalink"><a href="#a730bb59dda98f19c61fe67360f0adb3a">◆ </a></span>add_term()</h2> |
| 245 |
|
| 246 |
<div class="memitem"> |
| 247 |
<div class="memproto"> |
| 248 |
<table class="memname"> |
| 249 |
<tr> |
| 250 |
<td class="memname">void Xapian::Document::add_term </td> |
| 251 |
<td>(</td> |
| 252 |
<td class="paramtype">const std::string &</td> <td class="paramname"><span class="paramname"><em>tname</em></span>, </td> |
| 253 |
</tr> |
| 254 |
<tr> |
| 255 |
<td class="paramkey"></td> |
| 256 |
<td></td> |
| 257 |
<td class="paramtype"><a class="el" href="namespaceXapian.html#a4464380f6fa0055b5f26b8d03ae170e2">Xapian::termcount</a></td> <td class="paramname"><span class="paramname"><em>wdfinc</em></span><span class="paramdefsep"> = </span><span class="paramdefval">1</span> )</td> |
| 258 |
</tr> |
| 259 |
</table> |
| 260 |
</div><div class="memdoc"> |
| 261 |
|
| 262 |
<p>Add a term to the document, without positional information. </p> |
| 263 |
<p>Any existing positional information for the term will be left unmodified.</p> |
| 264 |
<dl class="params"><dt>Parameters</dt><dd> |
| 265 |
<table class="params"> |
| 266 |
<tr><td class="paramname">tname</td><td>The name of the term. </td></tr> |
| 267 |
<tr><td class="paramname">wdfinc</td><td>The increment that will be applied to the wdf for this term (default: 1). </td></tr> |
| 268 |
</table> |
| 269 |
</dd> |
| 270 |
</dl> |
| 271 |
|
| 272 |
<p class="reference">Referenced by <a class="el" href="#a5dcc3df00ccb9ab3a8dee594f603d299">add_boolean_term()</a>.</p> |
| 273 |
|
| 274 |
</div> |
| 275 |
</div> |
| 276 |
<a id="a12857fccd3448ec1db91311c16d67f6c" name="a12857fccd3448ec1db91311c16d67f6c"></a> |
| 277 |
<h2 class="memtitle"><span class="permalink"><a href="#a12857fccd3448ec1db91311c16d67f6c">◆ </a></span>add_value()</h2> |
| 278 |
|
| 279 |
<div class="memitem"> |
| 280 |
<div class="memproto"> |
| 281 |
<table class="memname"> |
| 282 |
<tr> |
| 283 |
<td class="memname">void Xapian::Document::add_value </td> |
| 284 |
<td>(</td> |
| 285 |
<td class="paramtype"><a class="el" href="namespaceXapian.html#a94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a></td> <td class="paramname"><span class="paramname"><em>slot</em></span>, </td> |
| 286 |
</tr> |
| 287 |
<tr> |
| 288 |
<td class="paramkey"></td> |
| 289 |
<td></td> |
| 290 |
<td class="paramtype">const std::string &</td> <td class="paramname"><span class="paramname"><em>value</em></span> )</td> |
| 291 |
</tr> |
| 292 |
</table> |
| 293 |
</div><div class="memdoc"> |
| 294 |
|
| 295 |
<p>Add a new value. </p> |
| 296 |
<p>The new value will replace any existing value with the same number (or if the new value is empty, it will remove any existing value with the same number).</p> |
| 297 |
<dl class="params"><dt>Parameters</dt><dd> |
| 298 |
<table class="params"> |
| 299 |
<tr><td class="paramname">slot</td><td>The value slot to add the value in. </td></tr> |
| 300 |
<tr><td class="paramname">value</td><td>The value to set. </td></tr> |
| 301 |
</table> |
| 302 |
</dd> |
| 303 |
</dl> |
| 304 |
|
| 305 |
</div> |
| 306 |
</div> |
| 307 |
<a id="ac72a216225acb299b73c1f6c8800ddce" name="ac72a216225acb299b73c1f6c8800ddce"></a> |
| 308 |
<h2 class="memtitle"><span class="permalink"><a href="#ac72a216225acb299b73c1f6c8800ddce">◆ </a></span>get_data()</h2> |
| 309 |
|
| 310 |
<div class="memitem"> |
| 311 |
<div class="memproto"> |
| 312 |
<table class="memname"> |
| 313 |
<tr> |
| 314 |
<td class="memname">std::string Xapian::Document::get_data </td> |
| 315 |
<td>(</td> |
| 316 |
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td> |
| 317 |
<td> const</td> |
| 318 |
</tr> |
| 319 |
</table> |
| 320 |
</div><div class="memdoc"> |
| 321 |
|
| 322 |
<p>Get data stored in the document. </p> |
| 323 |
<p>This is potentially a relatively expensive operation, and shouldn't normally be used during the match (e.g. in a <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an "external" source of postings.">PostingSource</a> or match decider functor. Put data for use by match deciders in a value instead. </p> |
| 324 |
|
| 325 |
</div> |
| 326 |
</div> |
| 327 |
<a id="a5920609db7fb6f27001b102aee5a47bd" name="a5920609db7fb6f27001b102aee5a47bd"></a> |
| 328 |
<h2 class="memtitle"><span class="permalink"><a href="#a5920609db7fb6f27001b102aee5a47bd">◆ </a></span>get_docid()</h2> |
| 329 |
|
| 330 |
<div class="memitem"> |
| 331 |
<div class="memproto"> |
| 332 |
<table class="memname"> |
| 333 |
<tr> |
| 334 |
<td class="memname"><a class="el" href="namespaceXapian.html#ad8f7a78bc920532b7d2baa3281b33e2f">docid</a> Xapian::Document::get_docid </td> |
| 335 |
<td>(</td> |
| 336 |
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td> |
| 337 |
<td> const</td> |
| 338 |
</tr> |
| 339 |
</table> |
| 340 |
</div><div class="memdoc"> |
| 341 |
|
| 342 |
<p>Get the document id which is associated with this document (if any). </p> |
| 343 |
<p>NB If multiple databases are being searched together, then this will be the document id in the individual database, not the merged database!</p> |
| 344 |
<dl class="section return"><dt>Returns</dt><dd>If this document came from a database, return the document id in that database. Otherwise, return 0 (in <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> 1.0.22/1.2.4 or later; prior to this the returned value was uninitialised). </dd></dl> |
| 345 |
|
| 346 |
</div> |
| 347 |
</div> |
| 348 |
<a id="a958c6063c67eae8b78242baa461b6389" name="a958c6063c67eae8b78242baa461b6389"></a> |
| 349 |
<h2 class="memtitle"><span class="permalink"><a href="#a958c6063c67eae8b78242baa461b6389">◆ </a></span>get_value()</h2> |
| 350 |
|
| 351 |
<div class="memitem"> |
| 352 |
<div class="memproto"> |
| 353 |
<table class="memname"> |
| 354 |
<tr> |
| 355 |
<td class="memname">std::string Xapian::Document::get_value </td> |
| 356 |
<td>(</td> |
| 357 |
<td class="paramtype"><a class="el" href="namespaceXapian.html#a94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a></td> <td class="paramname"><span class="paramname"><em>slot</em></span></td><td>)</td> |
| 358 |
<td> const</td> |
| 359 |
</tr> |
| 360 |
</table> |
| 361 |
</div><div class="memdoc"> |
| 362 |
|
| 363 |
<p>Get value by number. </p> |
| 364 |
<p>Returns an empty string if no value with the given number is present in the document.</p> |
| 365 |
<dl class="params"><dt>Parameters</dt><dd> |
| 366 |
<table class="params"> |
| 367 |
<tr><td class="paramname">slot</td><td>The number of the value. </td></tr> |
| 368 |
</table> |
| 369 |
</dd> |
| 370 |
</dl> |
| 371 |
|
| 372 |
</div> |
| 373 |
</div> |
| 374 |
<a id="a470144b154e9a7ec40b0875a8d636b9b" name="a470144b154e9a7ec40b0875a8d636b9b"></a> |
| 375 |
<h2 class="memtitle"><span class="permalink"><a href="#a470144b154e9a7ec40b0875a8d636b9b">◆ </a></span>operator=()</h2> |
| 376 |
|
| 377 |
<div class="memitem"> |
| 378 |
<div class="memproto"> |
| 379 |
<table class="memname"> |
| 380 |
<tr> |
| 381 |
<td class="memname">void Xapian::Document::operator= </td> |
| 382 |
<td>(</td> |
| 383 |
<td class="paramtype">const Document &</td> <td class="paramname"><span class="paramname"><em>other</em></span></td><td>)</td> |
| 384 |
<td></td> |
| 385 |
</tr> |
| 386 |
</table> |
| 387 |
</div><div class="memdoc"> |
| 388 |
|
| 389 |
<p>Assignment is allowed. </p> |
| 390 |
<p>The internals are reference counted, so assignment is cheap.</p> |
| 391 |
<dl class="params"><dt>Parameters</dt><dd> |
| 392 |
<table class="params"> |
| 393 |
<tr><td class="paramname">other</td><td>The object to copy. </td></tr> |
| 394 |
</table> |
| 395 |
</dd> |
| 396 |
</dl> |
| 397 |
|
| 398 |
<p class="reference">References <a class="el" href="#a470144b154e9a7ec40b0875a8d636b9b">operator=()</a>.</p> |
| 399 |
|
| 400 |
<p class="reference">Referenced by <a class="el" href="#a470144b154e9a7ec40b0875a8d636b9b">operator=()</a>.</p> |
| 401 |
|
| 402 |
</div> |
| 403 |
</div> |
| 404 |
<a id="a11eec629737e496a7077b87f763967a5" name="a11eec629737e496a7077b87f763967a5"></a> |
| 405 |
<h2 class="memtitle"><span class="permalink"><a href="#a11eec629737e496a7077b87f763967a5">◆ </a></span>remove_posting()</h2> |
| 406 |
|
| 407 |
<div class="memitem"> |
| 408 |
<div class="memproto"> |
| 409 |
<table class="memname"> |
| 410 |
<tr> |
| 411 |
<td class="memname">void Xapian::Document::remove_posting </td> |
| 412 |
<td>(</td> |
| 413 |
<td class="paramtype">const std::string &</td> <td class="paramname"><span class="paramname"><em>tname</em></span>, </td> |
| 414 |
</tr> |
| 415 |
<tr> |
| 416 |
<td class="paramkey"></td> |
| 417 |
<td></td> |
| 418 |
<td class="paramtype"><a class="el" href="namespaceXapian.html#ae1faeb9bd109b4d78a02d4b5f7b123ed">Xapian::termpos</a></td> <td class="paramname"><span class="paramname"><em>tpos</em></span>, </td> |
| 419 |
</tr> |
| 420 |
<tr> |
| 421 |
<td class="paramkey"></td> |
| 422 |
<td></td> |
| 423 |
<td class="paramtype"><a class="el" href="namespaceXapian.html#a4464380f6fa0055b5f26b8d03ae170e2">Xapian::termcount</a></td> <td class="paramname"><span class="paramname"><em>wdfdec</em></span><span class="paramdefsep"> = </span><span class="paramdefval">1</span> )</td> |
| 424 |
</tr> |
| 425 |
</table> |
| 426 |
</div><div class="memdoc"> |
| 427 |
|
| 428 |
<p>Remove a posting of a term from the document. </p> |
| 429 |
<p>Note that the term will still index the document even if all occurrences are removed. To remove a term from a document completely, use <a class="el" href="#a01e5b7bf54fdee77a978c3b5f1b007ba" title="Remove a term and all postings associated with it.">remove_term()</a>.</p> |
| 430 |
<dl class="params"><dt>Parameters</dt><dd> |
| 431 |
<table class="params"> |
| 432 |
<tr><td class="paramname">tname</td><td>The name of the term. </td></tr> |
| 433 |
<tr><td class="paramname">tpos</td><td>The position of the term. </td></tr> |
| 434 |
<tr><td class="paramname">wdfdec</td><td>The decrement that will be applied to the wdf when removing this posting. The wdf will not go below the value of 0.</td></tr> |
| 435 |
</table> |
| 436 |
</dd> |
| 437 |
</dl> |
| 438 |
<dl class="exception"><dt>Exceptions</dt><dd> |
| 439 |
<table class="exception"> |
| 440 |
<tr><td class="paramname"><a class="el" href="classXapian_1_1InvalidArgumentError.html" title="InvalidArgumentError indicates an invalid parameter value was passed to the API.">Xapian::InvalidArgumentError</a></td><td>will be thrown if the term is not at the position specified in the position list for this term in this document.</td></tr> |
| 441 |
<tr><td class="paramname"><a class="el" href="classXapian_1_1InvalidArgumentError.html" title="InvalidArgumentError indicates an invalid parameter value was passed to the API.">Xapian::InvalidArgumentError</a></td><td>will be thrown if the term is not in the document </td></tr> |
| 442 |
</table> |
| 443 |
</dd> |
| 444 |
</dl> |
| 445 |
|
| 446 |
</div> |
| 447 |
</div> |
| 448 |
<a id="a40ef21aa8a3664612bf1792b9fbad207" name="a40ef21aa8a3664612bf1792b9fbad207"></a> |
| 449 |
<h2 class="memtitle"><span class="permalink"><a href="#a40ef21aa8a3664612bf1792b9fbad207">◆ </a></span>remove_postings()</h2> |
| 450 |
|
| 451 |
<div class="memitem"> |
| 452 |
<div class="memproto"> |
| 453 |
<table class="memname"> |
| 454 |
<tr> |
| 455 |
<td class="memname"><a class="el" href="namespaceXapian.html#ae1faeb9bd109b4d78a02d4b5f7b123ed">Xapian::termpos</a> Xapian::Document::remove_postings </td> |
| 456 |
<td>(</td> |
| 457 |
<td class="paramtype">const std::string &</td> <td class="paramname"><span class="paramname"><em>term</em></span>, </td> |
| 458 |
</tr> |
| 459 |
<tr> |
| 460 |
<td class="paramkey"></td> |
| 461 |
<td></td> |
| 462 |
<td class="paramtype"><a class="el" href="namespaceXapian.html#ae1faeb9bd109b4d78a02d4b5f7b123ed">Xapian::termpos</a></td> <td class="paramname"><span class="paramname"><em>term_pos_first</em></span>, </td> |
| 463 |
</tr> |
| 464 |
<tr> |
| 465 |
<td class="paramkey"></td> |
| 466 |
<td></td> |
| 467 |
<td class="paramtype"><a class="el" href="namespaceXapian.html#ae1faeb9bd109b4d78a02d4b5f7b123ed">Xapian::termpos</a></td> <td class="paramname"><span class="paramname"><em>term_pos_last</em></span>, </td> |
| 468 |
</tr> |
| 469 |
<tr> |
| 470 |
<td class="paramkey"></td> |
| 471 |
<td></td> |
| 472 |
<td class="paramtype"><a class="el" href="namespaceXapian.html#a4464380f6fa0055b5f26b8d03ae170e2">Xapian::termcount</a></td> <td class="paramname"><span class="paramname"><em>wdf_dec</em></span><span class="paramdefsep"> = </span><span class="paramdefval">1</span> )</td> |
| 473 |
</tr> |
| 474 |
</table> |
| 475 |
</div><div class="memdoc"> |
| 476 |
|
| 477 |
<p>Remove a range of postings for a term. </p> |
| 478 |
<p>Any instances of the term at positions >= <em class="arg">term_pos_first</em> and <= <em class="arg">term_pos_last</em> will be removed, and the wdf reduced by <em class="arg">wdf_dec</em> for each instance removed (the wdf will not ever go below zero though).</p> |
| 479 |
<p>It's OK if the term doesn't occur in the range of positions specified (unlike <em class="arg"><a class="el" href="#a11eec629737e496a7077b87f763967a5" title="Remove a posting of a term from the document.">remove_posting()</a></em>). And if term_pos_first > term_pos_last, this method does nothing.</p> |
| 480 |
<dl class="section return"><dt>Returns</dt><dd>The number of postings removed.</dd></dl> |
| 481 |
<dl class="exception"><dt>Exceptions</dt><dd> |
| 482 |
<table class="exception"> |
| 483 |
<tr><td class="paramname"><a class="el" href="classXapian_1_1InvalidArgumentError.html" title="InvalidArgumentError indicates an invalid parameter value was passed to the API.">Xapian::InvalidArgumentError</a></td><td>will be thrown if the term is not in the document</td></tr> |
| 484 |
</table> |
| 485 |
</dd> |
| 486 |
</dl> |
| 487 |
<dl class="section since"><dt>Since</dt><dd>Added in <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> 1.4.8. </dd></dl> |
| 488 |
|
| 489 |
</div> |
| 490 |
</div> |
| 491 |
<a id="a01e5b7bf54fdee77a978c3b5f1b007ba" name="a01e5b7bf54fdee77a978c3b5f1b007ba"></a> |
| 492 |
<h2 class="memtitle"><span class="permalink"><a href="#a01e5b7bf54fdee77a978c3b5f1b007ba">◆ </a></span>remove_term()</h2> |
| 493 |
|
| 494 |
<div class="memitem"> |
| 495 |
<div class="memproto"> |
| 496 |
<table class="memname"> |
| 497 |
<tr> |
| 498 |
<td class="memname">void Xapian::Document::remove_term </td> |
| 499 |
<td>(</td> |
| 500 |
<td class="paramtype">const std::string &</td> <td class="paramname"><span class="paramname"><em>tname</em></span></td><td>)</td> |
| 501 |
<td></td> |
| 502 |
</tr> |
| 503 |
</table> |
| 504 |
</div><div class="memdoc"> |
| 505 |
|
| 506 |
<p>Remove a term and all postings associated with it. </p> |
| 507 |
<dl class="params"><dt>Parameters</dt><dd> |
| 508 |
<table class="params"> |
| 509 |
<tr><td class="paramname">tname</td><td>The name of the term.</td></tr> |
| 510 |
</table> |
| 511 |
</dd> |
| 512 |
</dl> |
| 513 |
<dl class="exception"><dt>Exceptions</dt><dd> |
| 514 |
<table class="exception"> |
| 515 |
<tr><td class="paramname"><a class="el" href="classXapian_1_1InvalidArgumentError.html" title="InvalidArgumentError indicates an invalid parameter value was passed to the API.">Xapian::InvalidArgumentError</a></td><td>will be thrown if the term is not in the document </td></tr> |
| 516 |
</table> |
| 517 |
</dd> |
| 518 |
</dl> |
| 519 |
|
| 520 |
</div> |
| 521 |
</div> |
| 522 |
<a id="ad46249a090c08abf04f5cb6ae8fdea1f" name="ad46249a090c08abf04f5cb6ae8fdea1f"></a> |
| 523 |
<h2 class="memtitle"><span class="permalink"><a href="#ad46249a090c08abf04f5cb6ae8fdea1f">◆ </a></span>serialise()</h2> |
| 524 |
|
| 525 |
<div class="memitem"> |
| 526 |
<div class="memproto"> |
| 527 |
<table class="memname"> |
| 528 |
<tr> |
| 529 |
<td class="memname">std::string Xapian::Document::serialise </td> |
| 530 |
<td>(</td> |
| 531 |
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td> |
| 532 |
<td> const</td> |
| 533 |
</tr> |
| 534 |
</table> |
| 535 |
</div><div class="memdoc"> |
| 536 |
|
| 537 |
<p>Serialise document into a string. </p> |
| 538 |
<p>The document representation may change between <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> releases: even between minor versions. However, it is guaranteed not to change if the remote database protocol has not changed between releases. </p> |
| 539 |
|
| 540 |
</div> |
| 541 |
</div> |
| 542 |
<a id="ab1b0da2e7c76acd754f29a52e14f89ae" name="ab1b0da2e7c76acd754f29a52e14f89ae"></a> |
| 543 |
<h2 class="memtitle"><span class="permalink"><a href="#ab1b0da2e7c76acd754f29a52e14f89ae">◆ </a></span>set_data()</h2> |
| 544 |
|
| 545 |
<div class="memitem"> |
| 546 |
<div class="memproto"> |
| 547 |
<table class="memname"> |
| 548 |
<tr> |
| 549 |
<td class="memname">void Xapian::Document::set_data </td> |
| 550 |
<td>(</td> |
| 551 |
<td class="paramtype">const std::string &</td> <td class="paramname"><span class="paramname"><em>data</em></span></td><td>)</td> |
| 552 |
<td></td> |
| 553 |
</tr> |
| 554 |
</table> |
| 555 |
</div><div class="memdoc"> |
| 556 |
|
| 557 |
<p>Set data stored in the document. </p> |
| 558 |
<p>This is an opaque blob as far as <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> is concerned - it's up to you to impose whatever structure you want on it. If you want to store structured data, consider using something like protocol buffers.</p> |
| 559 |
<dl class="params"><dt>Parameters</dt><dd> |
| 560 |
<table class="params"> |
| 561 |
<tr><td class="paramname">data</td><td>The data to store. </td></tr> |
| 562 |
</table> |
| 563 |
</dd> |
| 564 |
</dl> |
| 565 |
|
| 566 |
</div> |
| 567 |
</div> |
| 568 |
<a id="a868f19157a88ecaf1131923fdd963d60" name="a868f19157a88ecaf1131923fdd963d60"></a> |
| 569 |
<h2 class="memtitle"><span class="permalink"><a href="#a868f19157a88ecaf1131923fdd963d60">◆ </a></span>termlist_begin()</h2> |
| 570 |
|
| 571 |
<div class="memitem"> |
| 572 |
<div class="memproto"> |
| 573 |
<table class="memname"> |
| 574 |
<tr> |
| 575 |
<td class="memname"><a class="el" href="classXapian_1_1TermIterator.html">TermIterator</a> Xapian::Document::termlist_begin </td> |
| 576 |
<td>(</td> |
| 577 |
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td> |
| 578 |
<td> const</td> |
| 579 |
</tr> |
| 580 |
</table> |
| 581 |
</div><div class="memdoc"> |
| 582 |
|
| 583 |
<p>Start iterating the terms in this document. </p> |
| 584 |
<p>The terms are returned in ascending string order (by byte value).</p> |
| 585 |
<p>Note that if the <a class="el" href="classXapian_1_1Document.html" title="A handle representing a document in a Xapian database.">Document</a> object came from a sharded database then the <a class="el" href="classXapian_1_1TermIterator.html" title="Class for iterating over a list of terms.">TermIterator</a> returned by this method only knows about the shard the document came from so calling get_termfreq() on it will give you the term frequency in that shard rather than in the combined database. </p> |
| 586 |
|
| 587 |
</div> |
| 588 |
</div> |
| 589 |
<a id="a79d8d9533db25fc468c122515eaf4a54" name="a79d8d9533db25fc468c122515eaf4a54"></a> |
| 590 |
<h2 class="memtitle"><span class="permalink"><a href="#a79d8d9533db25fc468c122515eaf4a54">◆ </a></span>termlist_count()</h2> |
| 591 |
|
| 592 |
<div class="memitem"> |
| 593 |
<div class="memproto"> |
| 594 |
<table class="memname"> |
| 595 |
<tr> |
| 596 |
<td class="memname"><a class="el" href="namespaceXapian.html#a4464380f6fa0055b5f26b8d03ae170e2">Xapian::termcount</a> Xapian::Document::termlist_count </td> |
| 597 |
<td>(</td> |
| 598 |
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td> |
| 599 |
<td> const</td> |
| 600 |
</tr> |
| 601 |
</table> |
| 602 |
</div><div class="memdoc"> |
| 603 |
|
| 604 |
<p>The length of the termlist - i.e. </p> |
| 605 |
<p>the number of different terms which index this document. </p> |
| 606 |
|
| 607 |
</div> |
| 608 |
</div> |
| 609 |
<hr/>The documentation for this class was generated from the following file:<ul> |
| 610 |
<li>xapian/<a class="el" href="document_8h.html">document.h</a></li> |
| 611 |
</ul> |
| 612 |
</div><!-- contents --> |
| 613 |
<!-- start footer part --> |
| 614 |
<hr class="footer"/><address class="footer"><small> |
| 615 |
Generated by <a href="https://www.doxygen.org/">Doxygen 1.15.0</a> |
| 616 |
</small></address> |
| 617 |
</body> |
| 618 |
</html> |