1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Xapian: API Documentation: xapian-core: Xapian::Document 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.9 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
var num=this.id.replace(/[^[0-9]/g,'');
var button=this.firstChild;
var sectionDiv=document.getElementById('dynsection'+num);
if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
sectionDiv.style.display='block';
button.src='open.gif';
}else{
sectionDiv.style.display='none';
button.src='closed.gif';
}
}
function initDynSections(){
var divs=document.getElementsByTagName('div');
var sectionCounter=1;
for(var i=0;i<divs.length-1;i++){
if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
var header=divs[i];
var section=divs[i+1];
var button=header.firstChild;
if (button!='IMG'){
divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
button=document.createElement('img');
divs[i].insertBefore(button,divs[i].firstChild);
}
header.style.cursor='pointer';
header.onclick=changeDisplayState;
header.id='dynheader'+sectionCounter;
button.src='closed.gif';
section.id='dynsection'+sectionCounter;
section.style.display='none';
section.style.marginLeft='14px';
sectionCounter++;
}
}
}
window.onload = initDynSections;
-->
</script>
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="namespaceXapian.html">Xapian</a>::<a class="el" href="classXapian_1_1Document.html">Document</a>
</div>
</div>
<div class="contents">
<h1>Xapian::Document Class Reference</h1><!-- doxytag: class="Xapian::Document" -->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.
<a href="#_details">More...</a>
<p>
<p>
<a href="classXapian_1_1Document-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"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#27316171adc74325e42d5e88b004e189">Document</a> (const <a class="el" href="classXapian_1_1Document.html">Document</a> &other)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Copying is allowed. <a href="#27316171adc74325e42d5e88b004e189"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#470144b154e9a7ec40b0875a8d636b9b">operator=</a> (const <a class="el" href="classXapian_1_1Document.html">Document</a> &other)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Assignment is allowed. <a href="#470144b154e9a7ec40b0875a8d636b9b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e75d6c6a48b1cfed5b85189cb766531b"></a><!-- doxytag: member="Xapian::Document::Document" ref="e75d6c6a48b1cfed5b85189cb766531b" args="()" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#e75d6c6a48b1cfed5b85189cb766531b">Document</a> ()</td></tr>
<tr><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>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="943a905545bd862dbc7281e6d66e5ee4"></a><!-- doxytag: member="Xapian::Document::~Document" ref="943a905545bd862dbc7281e6d66e5ee4" args="()" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#943a905545bd862dbc7281e6d66e5ee4">~Document</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#1d8567908657c0d60a47c7ca30a08ebc">get_value</a> (<a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> slot) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get value by number. <a href="#1d8567908657c0d60a47c7ca30a08ebc"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#12857fccd3448ec1db91311c16d67f6c">add_value</a> (<a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> slot, const std::string &value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a new value. <a href="#12857fccd3448ec1db91311c16d67f6c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6ffd0e3d1beb8f047b3158a5e5aa41d4"></a><!-- doxytag: member="Xapian::Document::remove_value" ref="6ffd0e3d1beb8f047b3158a5e5aa41d4" args="(Xapian::valueno slot)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#6ffd0e3d1beb8f047b3158a5e5aa41d4">remove_value</a> (<a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> slot)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Remove any value with the given number. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="99f8cb1deeab46df42fed52ea4f55eb9"></a><!-- doxytag: member="Xapian::Document::clear_values" ref="99f8cb1deeab46df42fed52ea4f55eb9" args="()" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#99f8cb1deeab46df42fed52ea4f55eb9">clear_values</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Remove all values associated with the document. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#767026a91f3a1421f3d23f7a170509d4">get_data</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get data stored in the document. <a href="#767026a91f3a1421f3d23f7a170509d4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#b1b0da2e7c76acd754f29a52e14f89ae">set_data</a> (const std::string &data)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set data stored in the document. <a href="#b1b0da2e7c76acd754f29a52e14f89ae"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#161943bb133fea0da4a21fa37621764b">add_posting</a> (const std::string &tname, <a class="el" href="namespaceXapian.html#e5a16f073d0c8ed54085a9de07248d45">Xapian::termpos</a> tpos, <a class="el" href="namespaceXapian.html#72b5a76dd8cfb7b251fe7986e86390cb">Xapian::termcount</a> wdfinc=1)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add an occurrence of a term at a particular position. <a href="#161943bb133fea0da4a21fa37621764b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#730bb59dda98f19c61fe67360f0adb3a">add_term</a> (const std::string &tname, <a class="el" href="namespaceXapian.html#72b5a76dd8cfb7b251fe7986e86390cb">Xapian::termcount</a> wdfinc=1)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a term to the document, without positional information. <a href="#730bb59dda98f19c61fe67360f0adb3a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#5dcc3df00ccb9ab3a8dee594f603d299">add_boolean_term</a> (const std::string &term)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a boolean filter term to the document. <a href="#5dcc3df00ccb9ab3a8dee594f603d299"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#11eec629737e496a7077b87f763967a5">remove_posting</a> (const std::string &tname, <a class="el" href="namespaceXapian.html#e5a16f073d0c8ed54085a9de07248d45">Xapian::termpos</a> tpos, <a class="el" href="namespaceXapian.html#72b5a76dd8cfb7b251fe7986e86390cb">Xapian::termcount</a> wdfdec=1)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Remove a posting of a term from the document. <a href="#11eec629737e496a7077b87f763967a5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#01e5b7bf54fdee77a978c3b5f1b007ba">remove_term</a> (const std::string &tname)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Remove a term and all postings associated with it. <a href="#01e5b7bf54fdee77a978c3b5f1b007ba"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0bd9e001ffd29b0678938522d4e37e5"></a><!-- doxytag: member="Xapian::Document::clear_terms" ref="a0bd9e001ffd29b0678938522d4e37e5" args="()" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#a0bd9e001ffd29b0678938522d4e37e5">clear_terms</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Remove all terms (and postings) from the document. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceXapian.html#72b5a76dd8cfb7b251fe7986e86390cb">Xapian::termcount</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#0249ddf18171ed53d851f9d82290eb62">termlist_count</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The length of the termlist - i.e. <a href="#0249ddf18171ed53d851f9d82290eb62"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="591cc11740bd0b293eaa77f117b7f0d6"></a><!-- doxytag: member="Xapian::Document::termlist_begin" ref="591cc11740bd0b293eaa77f117b7f0d6" args="() const " -->
<a class="el" href="classXapian_1_1TermIterator.html">TermIterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#591cc11740bd0b293eaa77f117b7f0d6">termlist_begin</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Iterator for the terms in this document. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b4ba488b850b48b4972bb4e5f8ccf241"></a><!-- doxytag: member="Xapian::Document::termlist_end" ref="b4ba488b850b48b4972bb4e5f8ccf241" args="() const " -->
<a class="el" href="classXapian_1_1TermIterator.html">TermIterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#b4ba488b850b48b4972bb4e5f8ccf241">termlist_end</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Equivalent end iterator for <a class="el" href="classXapian_1_1Document.html#591cc11740bd0b293eaa77f117b7f0d6" title="Iterator for the terms in this document.">termlist_begin()</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="139251ac7b57e67703f797b06793d21c"></a><!-- doxytag: member="Xapian::Document::values_count" ref="139251ac7b57e67703f797b06793d21c" args="() const " -->
<a class="el" href="namespaceXapian.html#72b5a76dd8cfb7b251fe7986e86390cb">Xapian::termcount</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#139251ac7b57e67703f797b06793d21c">values_count</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Count the values in this document. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1ed6315d39adbc6f3e19d7bcc95ad3fe"></a><!-- doxytag: member="Xapian::Document::values_begin" ref="1ed6315d39adbc6f3e19d7bcc95ad3fe" args="() const " -->
<a class="el" href="classXapian_1_1ValueIterator.html">ValueIterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#1ed6315d39adbc6f3e19d7bcc95ad3fe">values_begin</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Iterator for the values in this document. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9f398562da8181e9eb37bb4df75aa33e"></a><!-- doxytag: member="Xapian::Document::values_end" ref="9f398562da8181e9eb37bb4df75aa33e" args="() const " -->
ValueIteratorEnd_ </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#9f398562da8181e9eb37bb4df75aa33e">values_end</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Equivalent end iterator for <a class="el" href="classXapian_1_1Document.html#1ed6315d39adbc6f3e19d7bcc95ad3fe" title="Iterator for the values in this document.">values_begin()</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceXapian.html#8fa9094bebe1256a7be935a5ede87a64">docid</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#03ff36283ac7d14a1a3b1c9fb26eff61">get_docid</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the document id which is associated with this document (if any). <a href="#03ff36283ac7d14a1a3b1c9fb26eff61"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#d6a7536cd6ed7c5b3fe4c9f1d14d6faf">serialise</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Serialise document into a string. <a href="#d6a7536cd6ed7c5b3fe4c9f1d14d6faf"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="eb93627c7cb0556c0935d5c2bb4f0847"></a><!-- doxytag: member="Xapian::Document::get_description" ref="eb93627c7cb0556c0935d5c2bb4f0847" args="() const " -->
std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#eb93627c7cb0556c0935d5c2bb4f0847">get_description</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a string describing this object. <br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3d7618710ea495101e4799fbe1952a41"></a><!-- doxytag: member="Xapian::Document::unserialise" ref="3d7618710ea495101e4799fbe1952a41" args="(const std::string &s)" -->
static <a class="el" href="classXapian_1_1Document.html">Document</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1Document.html#3d7618710ea495101e4799fbe1952a41">unserialise</a> (const std::string &s)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Unserialise a document from a string produced by <a class="el" href="classXapian_1_1Document.html#d6a7536cd6ed7c5b3fe4c9f1d14d6faf" title="Serialise document into a string.">serialise()</a>. <br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
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>
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>
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#f140b1f8d948d13cf7be4a11a7c699a4" 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>
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>
doc = <a class="el" href="classXapian_1_1Document.html#3d7618710ea495101e4799fbe1952a41" title="Unserialise a document from a string produced by serialise().">Xapian::Document::unserialise</a>(doc.serialise()); <hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="27316171adc74325e42d5e88b004e189"></a><!-- doxytag: member="Xapian::Document::Document" ref="27316171adc74325e42d5e88b004e189" args="(const Document &other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Xapian::Document::Document </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classXapian_1_1Document.html">Document</a> & </td>
<td class="paramname"> <em>other</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Copying is allowed.
<p>
The internals are reference counted, so copying is cheap.<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>other</em> </td><td>The object to copy. </td></tr>
</table>
</dl>
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="5dcc3df00ccb9ab3a8dee594f603d299"></a><!-- doxytag: member="Xapian::Document::add_boolean_term" ref="5dcc3df00ccb9ab3a8dee594f603d299" args="(const std::string &term)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Xapian::Document::add_boolean_term </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>term</em> </td>
<td> ) </td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Add a boolean filter term to the document.
<p>
This method adds <em>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>
If the specified term already indexes this document, this method has no effect.<p>
It is exactly the same as add_term(term, 0).<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>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>term</em> </td><td>The term to add. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="161943bb133fea0da4a21fa37621764b"></a><!-- doxytag: member="Xapian::Document::add_posting" ref="161943bb133fea0da4a21fa37621764b" args="(const std::string &tname, Xapian::termpos tpos, Xapian::termcount wdfinc=1)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Xapian::Document::add_posting </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>tname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="namespaceXapian.html#e5a16f073d0c8ed54085a9de07248d45">Xapian::termpos</a> </td>
<td class="paramname"> <em>tpos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="namespaceXapian.html#72b5a76dd8cfb7b251fe7986e86390cb">Xapian::termcount</a> </td>
<td class="paramname"> <em>wdfinc</em> = <code>1</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Add an occurrence of a term at a particular position.
<p>
Multiple occurrences of the term at the same position are represented only once in the positional information, but do increase the wdf.<p>
If the term is not already in the document, it will be added to it.<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>tname</em> </td><td>The name of the term. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>tpos</em> </td><td>The position of the term. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>wdfinc</em> </td><td>The increment that will be applied to the wdf for this term. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="730bb59dda98f19c61fe67360f0adb3a"></a><!-- doxytag: member="Xapian::Document::add_term" ref="730bb59dda98f19c61fe67360f0adb3a" args="(const std::string &tname, Xapian::termcount wdfinc=1)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Xapian::Document::add_term </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>tname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="namespaceXapian.html#72b5a76dd8cfb7b251fe7986e86390cb">Xapian::termcount</a> </td>
<td class="paramname"> <em>wdfinc</em> = <code>1</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Add a term to the document, without positional information.
<p>
Any existing positional information for the term will be left unmodified.<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>tname</em> </td><td>The name of the term. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>wdfinc</em> </td><td>The increment that will be applied to the wdf for this term (default: 1). </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="12857fccd3448ec1db91311c16d67f6c"></a><!-- doxytag: member="Xapian::Document::add_value" ref="12857fccd3448ec1db91311c16d67f6c" args="(Xapian::valueno slot, const std::string &value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Xapian::Document::add_value </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> </td>
<td class="paramname"> <em>slot</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>value</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Add a new value.
<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>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>slot</em> </td><td>The value slot to add the value in. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>The value to set. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="767026a91f3a1421f3d23f7a170509d4"></a><!-- doxytag: member="Xapian::Document::get_data" ref="767026a91f3a1421f3d23f7a170509d4" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string Xapian::Document::get_data </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get data stored in the document.
<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.
</div>
</div><p>
<a class="anchor" name="03ff36283ac7d14a1a3b1c9fb26eff61"></a><!-- doxytag: member="Xapian::Document::get_docid" ref="03ff36283ac7d14a1a3b1c9fb26eff61" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespaceXapian.html#8fa9094bebe1256a7be935a5ede87a64">docid</a> Xapian::Document::get_docid </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get the document id which is associated with this document (if any).
<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>
<dl class="return" compact><dt><b>Returns:</b></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>
</div>
</div><p>
<a class="anchor" name="1d8567908657c0d60a47c7ca30a08ebc"></a><!-- doxytag: member="Xapian::Document::get_value" ref="1d8567908657c0d60a47c7ca30a08ebc" args="(Xapian::valueno slot) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string Xapian::Document::get_value </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> </td>
<td class="paramname"> <em>slot</em> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get value by number.
<p>
Returns an empty string if no value with the given number is present in the document.<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>slot</em> </td><td>The number of the value. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="470144b154e9a7ec40b0875a8d636b9b"></a><!-- doxytag: member="Xapian::Document::operator=" ref="470144b154e9a7ec40b0875a8d636b9b" args="(const Document &other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Xapian::Document::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classXapian_1_1Document.html">Document</a> & </td>
<td class="paramname"> <em>other</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Assignment is allowed.
<p>
The internals are reference counted, so assignment is cheap.<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>other</em> </td><td>The object to copy. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="11eec629737e496a7077b87f763967a5"></a><!-- doxytag: member="Xapian::Document::remove_posting" ref="11eec629737e496a7077b87f763967a5" args="(const std::string &tname, Xapian::termpos tpos, Xapian::termcount wdfdec=1)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Xapian::Document::remove_posting </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>tname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="namespaceXapian.html#e5a16f073d0c8ed54085a9de07248d45">Xapian::termpos</a> </td>
<td class="paramname"> <em>tpos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="namespaceXapian.html#72b5a76dd8cfb7b251fe7986e86390cb">Xapian::termcount</a> </td>
<td class="paramname"> <em>wdfdec</em> = <code>1</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Remove a posting of a term from the document.
<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="classXapian_1_1Document.html#01e5b7bf54fdee77a978c3b5f1b007ba" title="Remove a term and all postings associated with it.">remove_term()</a>.<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>tname</em> </td><td>The name of the term. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>tpos</em> </td><td>The position of the term. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>wdfdec</em> </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>
</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_1InvalidArgumentError.html" title="InvalidArgumentError indicates an invalid parameter value was passed to the API.">Xapian::InvalidArgumentError</a></em> </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>
<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> </td><td>will be thrown if the term is not in the document </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="01e5b7bf54fdee77a978c3b5f1b007ba"></a><!-- doxytag: member="Xapian::Document::remove_term" ref="01e5b7bf54fdee77a978c3b5f1b007ba" args="(const std::string &tname)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Xapian::Document::remove_term </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>tname</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Remove a term and all postings associated with it.
<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>tname</em> </td><td>The name of the term.</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_1InvalidArgumentError.html" title="InvalidArgumentError indicates an invalid parameter value was passed to the API.">Xapian::InvalidArgumentError</a></em> </td><td>will be thrown if the term is not in the document </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="d6a7536cd6ed7c5b3fe4c9f1d14d6faf"></a><!-- doxytag: member="Xapian::Document::serialise" ref="d6a7536cd6ed7c5b3fe4c9f1d14d6faf" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string Xapian::Document::serialise </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Serialise document into a string.
<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.
</div>
</div><p>
<a class="anchor" name="b1b0da2e7c76acd754f29a52e14f89ae"></a><!-- doxytag: member="Xapian::Document::set_data" ref="b1b0da2e7c76acd754f29a52e14f89ae" args="(const std::string &data)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Xapian::Document::set_data </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>data</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Set data stored in the document.
<p>
<a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> treats the data as an opaque blob. It may try to compress it, but other than that it will just store it and return it when requested.<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>data</em> </td><td>The data to store. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="0249ddf18171ed53d851f9d82290eb62"></a><!-- doxytag: member="Xapian::Document::termlist_count" ref="0249ddf18171ed53d851f9d82290eb62" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespaceXapian.html#72b5a76dd8cfb7b251fe7986e86390cb">Xapian::termcount</a> Xapian::Document::termlist_count </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The length of the termlist - i.e.
<p>
the number of different terms which index this document.
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>xapian/<a class="el" href="document_8h.html">document.h</a></ul>
</div>
<hr>
<address><small>
Documentation for Xapian (version 1.2.12).<br>
Generated on 27 Jun 2012 by
<a href="http://www.doxygen.org/">Doxygen 1.5.9</a>.
</small></address>
</body>
</html>
|