# document.save

Canonical URL: https://developers.iagenify.com/zh/sdk/workflows/steps/document-save/
Language: zh

`type: "document.save"`

将文件写入存储器并索引, 以后的语义搜索可以找到它。

Status: storage and path required · indexes it · chunks reported

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `storage` | string | 必填 | 哪里去,它去。 来。 |
| `path` | string | 必填 | 文档的名称 。 |
| `content` | any |  | 案文内容。 |
| `contentBase64` | string |  | 字节- a PDF, a , a , a , a DOCX. |

```javascript
{ id: "index", type: "document.save", config: {
    storage: "…", path: "digests/{{input.week}}.md",
    content: "{{steps.write.output.text}}" } }
```

## 指数化加什么 {#difference}

> **环环关闭 链条无法自己关闭**
>
> 语义搜索只找到索引的内容。 没有这一步骤,工作流程可以产生一百份报告,而永远无法找到其中的一份报告。

## 输出 {#output}

```javascript
{{steps.index.output.document}}   // its identifier
{{steps.index.output.chunks}}     // how many pieces were indexed
{{steps.index.output.bytes}}
```

## 找找找再找找 {#finding}

```javascript
{ id: "recall", type: "storage.query", config: {
    storage: "…", action: "search", query: "{{input.question}}" } }
```

## 费用 {#cost}

与任何文件一样, 存储的字节计数。 搜索后发现每通电话都要花费一个信用额 。

- [file.save](/zh/sdk/workflows/steps/file-save): 书写时没有索引。
- [storage.query](/zh/sdk/workflows/steps/storage-query): 正在搜索。
- [工作流步骤](/zh/sdk/workflows/steps): 全部 23 种类型。

```python
{"id": "index", "type": "document.save", "config": {
    "storage": "…", "path": "digests/{{input.week}}.md",
    "content": "{{steps.write.output.text}}"}}
```

```python
"{{steps.index.output.document}}"   # its identifier
"{{steps.index.output.chunks}}"     # how many pieces were indexed
"{{steps.index.output.bytes}}"
```

```python
{"id": "recall", "type": "storage.query", "config": {
    "storage": "…", "action": "search", "query": "{{input.question}}"}}
```
