DocumentWriter
Writes documents to a DocumentStore.
Basic Information
- Type:
haystack_integrations.writers.document_writer.DocumentWriter
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| documents | List[Document] | A list of documents to write to the document store. | |
| policy | Optional[DuplicatePolicy] | None | The policy to use when encountering duplicate documents. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| documents_written | int | Number of documents written to the document store. |
Overview
Work in Progress
Bear with us while we're working on adding pipeline examples and most common components connections.
Writes documents to a DocumentStore.
Usage Example
components:
DocumentWriter:
type: components.writers.document_writer.DocumentWriter
init_parameters:
Parameters
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
| document_store | DocumentStore | The instance of the document store where you want to store your documents. | |
| policy | DuplicatePolicy | DuplicatePolicy.NONE | The policy to apply when a Document with the same ID already exists in the DocumentStore. - DuplicatePolicy.NONE: Default policy, relies on the DocumentStore settings. - DuplicatePolicy.SKIP: Skips documents with the same ID and doesn't write them to the DocumentStore. - DuplicatePolicy.OVERWRITE: Overwrites documents with the same ID. - DuplicatePolicy.FAIL: Raises an error if a Document with the same ID is already in the DocumentStore. |
Run Method Parameters
These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.
| Parameter | Type | Default | Description |
|---|---|---|---|
| documents | List[Document] | A list of documents to write to the document store. | |
| policy | Optional[DuplicatePolicy] | None | The policy to use when encountering duplicate documents. |
Was this page helpful?