# IRPCIndexingDataSource2.GetTextContentForFileForIX

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Server integration API](https://developer.m-files.com/APIs/gRPC-API/integration/index.md) > [Indexing data source (version 2)](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCIndexingDataSource2/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCIndexingDataSource2/GetTextContentForFileForIX/

Badges: `Server integration API / specialized` `internal: not for applications` `read` `session` `idempotent`

Gets the text that the server extracts from a file version for indexing, in the response.

The text is the same that the search index receives: it is produced with the vault's full-text
extraction settings even when viewer files are disabled for users, and it is cached on the server
for later use.

- **Service:** [Indexing data source (version 2)](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCIndexingDataSource2/index.md) `MFiles.IRPCIndexingDataSource2`
- **gRPC method:** `/MFiles.IRPCIndexingDataSource2/GetTextContentForFileForIX`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-text-content-for-file-for-ix`
- **Request:** [`GetTextContentForFileForIXRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCIndexingDataSource2/GetTextContentForFileForIX/index.md#request)
- **Response:** [`GetTextContentForFileForIXResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCIndexingDataSource2/GetTextContentForFileForIX/index.md#response)
- **Book and level:** Server integration API, specialized
- **Kind:** read
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

**For M-Files components only.** M-Files' cloud search indexing services call it. Applications
should not call it.
- Requires a vault session with the vault rights `see_all_objects` and `see_deleted_objects`.
- May create and cache the text extract of the file on the server.
- A file with no extractable text returns an empty `text_content`. A file whose extraction failed
  returns `text_unavailable` true. External (unmanaged) files fail with "Not implemented.".

<a id="request"></a>

## Request: GetTextContentForFileForIXRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `obj_file_ver` | [`ObjFileVer`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjFileVer/index.md) | The object and file version. |
| `obj_file_ver.obj_id` | [`ObjID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjID/index.md) | The object that owns the file. |
| `obj_file_ver.obj_id.type` | `int32` | The object type ID, for example 0 for documents. In a lookup value, the value list ID (for a lookup to objects, the object type ID). |
| `obj_file_ver.obj_id.item_id` | [`ItemID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ItemID/index.md) | The ID of the object within its type, in `item_id.internal_id`. |
| `obj_file_ver.file_ver` | [`FileVer`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileVer/index.md) | The specific file version, as in `File.file_ver`. |
| `obj_file_ver.file_ver.file_id` | [`FileID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.FileID/index.md) | The file. |
| `obj_file_ver.file_ver.type` | [`FileVerType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileVerType/index.md) | `FILE_VER_TYPE_SPECIFIC` for a file version number. Values: `FILE_VER_TYPE_UNINITIALIZED` (0), `FILE_VER_TYPE_LATEST` (1), `FILE_VER_TYPE_ANY` (2), `FILE_VER_TYPE_SPECIFIC` (3). |
| `obj_file_ver.file_ver.internal_version` | `int32` | The file version number. |
| `obj_file_ver.file_ver.external_repository_version` | `string` | Used only for files in external repositories. Leave empty. |
| `obj_file_ver.file_ver.external_repository_sort_key` | `int64` | Used only for files in external repositories. Leave 0. |
| `file_format` | [`FileFormat`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileFormat/index.md) | `FILE_FORMAT_PLAIN_TEXT` or `FILE_FORMAT_MARKDOWN`; unset (`FILE_FORMAT_NATIVE`) means plain text. A Markdown request falls back to plain text when the server cannot produce Markdown. Values: `FILE_FORMAT_NATIVE` (0), `FILE_FORMAT_PDF` (1), `FILE_FORMAT_DISPLAY_ONLY_PDF` (2), `FILE_FORMAT_PLAIN_TEXT` (3), `FILE_FORMAT_MARKDOWN` (4). |

<a id="response"></a>

## Response: GetTextContentForFileForIXResponse

The response of GetTextContentForFileForIX: the extracted text in the response body and the
format actually produced.

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `text_content` | `string` | The extracted text (UTF-8). Empty when the file has no extractable text. |
| `file_format` | [`FileFormat`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.FileFormat/index.md) | The format actually produced. Values: `FILE_FORMAT_NATIVE` (0), `FILE_FORMAT_PDF` (1), `FILE_FORMAT_DISPLAY_ONLY_PDF` (2), `FILE_FORMAT_PLAIN_TEXT` (3), `FILE_FORMAT_MARKDOWN` (4). |
| `text_unavailable` | `bool` | True when no text could be produced for a non-empty file; `text_content` is then empty and says nothing about the file. |
