# perldoc > Plucene::Document

---
type: CommandReference
command: Plucene::Document
mode: perldoc
section: 
source: perldoc
---

## Quick Reference

- `Plucene::Document->new` — create a new document
- `$document->add(Plucene::Document::Field $field)` — add a field to the document
- `$document->get($field_name)` — retrieve a field by name
- `$document->fields` — return list of all fields

## Name

Plucene::Document — The unit of indexing and searching

## Synopsis

perl
my $document = Plucene::Document->new;

$document->add(Plucene::Document::Field $field);
my Plucene::Document::Field $field = $document->get($field_name);

my Plucene::Document::Fields @fields = $document->fields;
## Methods

- `$document->get($field_name)` — returns the [Plucene::Document::Field](https://www.chedong.com/phpMan.php/perldoc/Plucene%3A%3ADocument%3A%3AField/markdown) object with the given name, or `undef` if none exists.
- `$document->add(Plucene::Document::Field $field)` — adds a field to the document.
- `$document->fields` — returns a list of all fields in the document.