---
name: "Plucene::Index::FieldsWriter"
section: "3pm"
platform: "linux"
package: "libplucene-perl"
version: "1.25-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Plucene::Index::FieldsWriter"
---

# Plucene::Index::FieldsWriter(3pm)

writes Fields to a Document

## NAME

Plucene::Index::FieldsWriter - writes Fields to a Document

## SYNOPSIS

```
        my $writer = Plucene::Index::FieldsWriter->new(
                $dir_name, $segment, $field_infos);
        $writer->add_document(Plucene::Document $doc);
```

## DESCRIPTION

This class add documents to the appropriate files.

## METHODS

### new

```
        my $writer = Plucene::Index::FieldsWriter->new(
                $dir_name, $segment, $field_infos);
```

This will create a new Plucene::Index::FieldsWriter object with the passed directory name, segment and field infos.

### close

```
        $writer->close;
```

### add\_document

```
        $writer->add_document(Plucene::Document $doc);
```

This will add the passed Plucene::Document.
