---
name: "Search::Xapian::Document"
section: "3pm"
platform: "linux"
package: "libsearch-xapian-perl"
version: "1.2.25.5-3+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Search::Xapian::Document"
---

# Search::Xapian::Document(3pm)

Document object

## NAME

Search::Xapian::Document - Document object

## DESCRIPTION

This class represents a document in a Xapian database.

## METHODS

- new

  Class constructor.

- clone

  Return a clone of this class.

- get\_value (value\_no)

  Returns the value by the assigned number.

- add\_value \<value\_no\> \<value\>

  Set a value by value number.

- remove\_value \<value\_no\>

  Removes the value with the assigned number.

- clear\_values

  Clear all set values.

- get\_data

  Return all document data.

- set\_data \<data\>

  Set all document data. This can be anything you like.

- add\_posting \<term\> \<position\> \[\<wdfinc\>\]

  Adds a term at the given position. wdfinc defaults to 1.

- remove\_posting \<term\> \<position\> \[\<wdfdec\>\]

  Removes a term from the given position. wdfdec defaults to 1.

- add\_term \<term\> \[\<wdfinc\>\]

  Adds a term without positional information. wdfinc defaults to 1.

- add\_boolean\_term \<term\>

  Adds a term intended for boolean filtering (its wdf contribution will be 0).

- remove\_term \<term\>

  Removes a term and all postings associated with it.

- clear\_terms

  Remove all terms from the document.

- termlist\_count

  Returns number of different terms in the document.

- termlist\_begin

  Iterator for the terms in this document. Returns a Search::Xapian::TermIterator.

- termlist\_end

  Equivalent end iterator for **termlist\_begin()**.  Returns a Search::Xapian::TermIterator.

- values\_count

  Return number of defined values for this document.

- values\_begin

  Return a Search::Xapian::ValueIterator pointing at the start of the values in this document.

- values\_end

  Return a Search::Xapian::ValueIterator pointing at the end of the values in this document.

- get\_description

  Return a description of this object.

## SEE ALSO

Search::Xapian::Database
