## Search Files

`beta.retrieval.search(RetrievalSearchParams**kwargs)  -> RetrievalSearchResponse`

**post** `/api/v1/retrieval/files/search`

Search for files by name.

### Parameters

- `index_id: str`

  ID of the index to search within.

- `organization_id: Optional[str]`

- `project_id: Optional[str]`

- `file_name: Optional[str]`

  Exact file name to match.

- `file_name_contains: Optional[str]`

  Substring match on file name (case-insensitive).

- `limit: Optional[int]`

  Maximum number of files to return.

### Returns

- `class RetrievalSearchResponse: …`

  File search results.

  - `files: List[File]`

    Matching files with names.

    - `file_id: str`

      ID of the file.

    - `file_name: str`

      Display name of the file.

### Example

```python
import os
from llama_cloud import LlamaCloud

client = LlamaCloud(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
response = client.beta.retrieval.search(
    index_id="idx-abc123",
)
print(response.files)
```

#### Response

```json
{
  "files": [
    {
      "file_id": "file_id",
      "file_name": "file_name"
    }
  ]
}
```
