Plucene::Document - The unit of indexing and searching
| Use Case | Command | Description |
|---|---|---|
| Create a new document | my $document = Plucene::Document->new; | Instantiate an empty document object |
| Add a field to the document | $document->add(Plucene::Document::Field $field); | Add a field object to the document |
| Retrieve a field by name | my $field = $document->get($field_name); | Get the field object for a given field name |
| List all fields | my @fields = $document->fields; | Get an array of all field objects in the document |
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;
Documents are the unit of indexing and search, and each document is a set of fields. Each field has a name and a textual value.
A field may be stored with the document, in which case it is returned with search hits on the document. Thus each document should typically contain stored fields which uniquely identify it.
my Plucene::Document::Field $field = $document->get($field_name);
This returns the Plucene::Document::Field object of the field with the given name if any exist in this document, or null.
$document->add(Plucene::Document::Field $field);
This will add a field to the document.
my Plucene::Document::Field @fields = $document->fields;
This returns a list of all the fields in a document.
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-17 04:55 @216.73.216.72
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)