你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。

Knowledge Sources - List Files

列出文件知识源中的所有文件。

GET {endpoint}/knowledgesources('{sourceName}')/files?api-version=2026-10-01
GET {endpoint}/knowledgesources('{sourceName}')/files?api-version=2026-10-01&prefix={prefix}&search={search}&pageSize={pageSize}&searchType=prefix

URI 参数

名称 在 必需 类型 说明
endpoint
path True

string (uri)

搜索服务的终结点 URL。

sourceName
path True

string

知识源的名称。

api-version
query True

string

minLength: 1

用于此操作的 API 版本。

pageSize
query

integer (int32)

minimum: 1
maximum: 3000

单页最多可返回的物品数量。 服务器强制执行最大值;如果省略,服务器会确定合适的默认值。

prefix
query

string

可选前缀可按目录类路径过滤文件。

search
query

string

用字符串缩小列表范围,减少需要翻页的结果。 如果省略或传递空弦,则不进行收窄。

searchType
query

ListingSearchType

指定搜索参数的解释方式。 目前只支持“前缀”。

请求标头

名称 必需 类型 说明
x-ms-client-request-id

string (uuid)

请求的不透明、全局唯一的客户端生成的字符串标识符。

Accept

Accept

接受(Accept)首部。

响应

名称 类型 说明
200 OK

ListKnowledgeSourceFilesResult

请求已成功。

Other Status Codes

ErrorResponse

未预期的错误响应。

安全性

api-key

类型: apiKey
在: header

OAuth2Auth

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

作用域

名称 说明
https://search.azure.com/.default

示例

SearchServiceListKnowledgeSourceFiles

示例请求

GET https://typespecstableexampleservice.search.windows.net/knowledgesources('ks-stable-test')/files?api-version=2026-10-01&prefix=&search=&pageSize=&searchType=prefix


示例响应

{
  "value": [
    {
      "fileId": "00000000-0000-0000-0000-000000000001",
      "fileName": "notes/build26/kr-features.md",
      "fileSizeBytes": 1184,
      "createdAt": "2026-08-03T17:04:22Z",
      "lastUpdatedAt": "2026-08-03T17:04:22Z",
      "prefix": "notes/build26/",
      "parsingMode": "markdown",
      "extractionMode": "minimal",
      "metadata": {
        "team": "kr",
        "source": "build26-notes"
      }
    }
  ]
}

定义

名称 说明
Accept

接受(Accept)首部。

BlobIndexerParsingMode

表示从 Azure blob 数据源编制索引的分析模式。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详情

ErrorResponse

所有 Azure 资源管理器 API 的常见错误响应,以返回失败作的错误详细信息。 (这也遵循 OData 错误响应格式)。

FileKnowledgeSourceExtractionMode

提取工作是针对单个文件。 “最小”(默认)使用内置提取;“标准”使用内容理解。

KnowledgeSourceFile

上传到文件知识源的文件元数据。

ListingSearchType

规定在缩小列表结果集时如何解释搜索参数。 目前只支持“前缀”。

ListKnowledgeSourceFilesResult

列表文件请求的回复。

Accept

接受(Accept)首部。

值 说明
application/json;odata.metadata=minimal

BlobIndexerParsingMode

表示从 Azure blob 数据源编制索引的分析模式。

值 说明
default

设置为正常文件处理的默认值。

text

设置为文本以提高 Blob 存储中纯文本文件的索引性能。

delimitedText

当 blob 是纯 CSV 文件时,设置为 delimitedText。

json

设置为 json 以从 JSON 文件中提取结构化内容。

jsonArray

设置为 jsonArray 以将 JSON 数组的各个元素提取为单独的文档。

jsonLines

设置为 jsonLines 以提取由新行分隔的单个 JSON 实体,作为单独的文档。

markdown

设置为 markdown 以从 markdown 文件中提取内容。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

附加信息。

type

string

其他信息类型。

ErrorDetail

错误详情

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误的附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详情。

message

string

错误消息。

target

string

错误的目标。

ErrorResponse

所有 Azure 资源管理器 API 的常见错误响应,以返回失败作的错误详细信息。 (这也遵循 OData 错误响应格式)。

名称 类型 说明
error

ErrorDetail

错误对象。

FileKnowledgeSourceExtractionMode

提取工作是针对单个文件。 “最小”(默认)使用内置提取;“标准”使用内容理解。

值 说明
minimal

还采用了内置抽取功能。

standard

进行了内容理解提取。

KnowledgeSourceFile

上传到文件知识源的文件元数据。

名称 类型 说明
createdAt

string (date-time)

文件创建的时间戳。

errorMessage

string

如果文件处理失败,则显示错误信息,否则为空。

extractionMode

FileKnowledgeSourceExtractionMode

提取模式应用到了文件上。

fileId

string

文件的唯一标识符。

fileName

string

原始文件名。

fileSizeBytes

integer (int64)

文件大小(以字节为单位)。

lastUpdatedAt

string (date-time)

文件最后更新的时间戳。

metadata

object

随文件存储的自定义键值元数据。 已退回,但无法搜索或筛选。

parsingMode

BlobIndexerParsingMode

解析模式应用到文件上(从文件中自动检测)。

prefix

string

前缀(类目录路径)源自完整文件名。

ListingSearchType

规定在缩小列表结果集时如何解释搜索参数。 目前只支持“前缀”。

值 说明
prefix

匹配名称以搜索参数值开头的项目。

ListKnowledgeSourceFilesResult

列表文件请求的回复。

名称 类型 说明
@odata.nextLink

string

可以用来获取下一组结果的URL。

value

KnowledgeSourceFile[]

文件清单。