Plucene::Document - The unit of indexing and searching
| Use Case | Command | Description |
|---|---|---|
| Create a new Document | my $doc = Plucene::Document->new; | Initialize a searchable document |
| Add a field | $doc->add(Plucene::Document::Field $field); | Attach a field to the document |
| Retrieve a field by name | my $field = $doc->get($name); | Get the field object |
| List all fields | my @fields = $doc->fields; | Get all fields 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::Field @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 an list of all the fields in a document.
Generated by phpman v4.9.29 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-20 18:36 @2600:1f28:365:80b0:8802:8bb4:3873:328e
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format