Tham chiếu API

Chỉ mục tệp

Tìm kiếm chỉ mục tệp đã lưu với phân trang và sắp xếp, hoặc đếm kết quả khớp với cùng truy vấn.

Volume scan scheduling

pause → PAUSED · resume → QUEUED

Định nghĩa kiểu

graphql
type Subscription {
  fileIndexScanProgressUpdated: FileIndexScanProgress!
}

type Query {
  indexedFileCount(query: String!): Long!
  indexedFiles(query: String!, offset: Int!, limit: Int!, sortBy: FileSortBy!): [File!]!
  fileIndexDefaults: FileIndexDefaults!
  fileIndexScanProgress(volumeId: ID): FileIndexScanProgress!
  fileIndexVolumes: [FileIndexVolume!]!
}

type Mutation {
  pauseFileIndex(volumeId: ID): Boolean!
  rebuildFileIndex(volumeId: ID): Boolean!
  resumeFileIndex(volumeId: ID): Boolean!
  setFileIndexVolume(volumeId: ID!, input: FileIndexVolumeInput!): Boolean!
  stopFileIndex(volumeId: ID): Boolean!
}

type File {
	permission: String!
	
	mediaId: ID
	name: String!
	path: String!
	createdAt: Instant
	updatedAt: Instant!
	size: Long!
	isDir: Boolean!
	childCount: Int!
	url: String!
	isSystem: Boolean!
}

type FileIndexDefaults {
	excludedDirs: [String!]!
	excludedNames: [String!]!
	
	excludedProfileDirs: [FileIndexProfileDir!]!
	
	mediaExcludedDirSuffixes: [String!]!
}

enum FileIndexMode {
	UNCONFIGURED
	DISABLED
	ALLOWLIST
	BLOCKLIST
}

type FileIndexProfileDir {
	
	profilesDir: String!
	
	excludedDir: String!
	
	exceptDirs: [String!]!
}

type FileIndexScanProgress {
	volumeId: ID
	indexed: Int!
	pending: Int
	total: Int
	state: FileIndexScanState!
	error: String
}

enum FileIndexScanState {
	IDLE
	QUEUED
	RUNNING
	PAUSED
	STOPPED
	FAILED
}

enum FileIndexScanStatus {
	COMPLETED
	CANCELED
	FAILED
}

type FileIndexVolume {
	id: ID!
	path: String!
	isAvailable: Boolean!
	indexMode: FileIndexMode!
	includedDirs: [String!]!
	excludedDirs: [String!]!
	lastScanAt: Instant
	lastScanStatus: FileIndexScanStatus
	lastScanCount: Long
	lastScanTotal: Long
}

input FileIndexVolumeInput {
	indexMode: FileIndexMode!
	includedDirs: [String!]!
	excludedDirs: [String!]!
}

enum FileSortBy {
	UPDATED_AT_ASC
	UPDATED_AT_DESC
	SIZE_ASC
	SIZE_DESC
	NAME_ASC
	NAME_DESC
}

scalar Instant

scalar Long

Thao tác

subscription

fileIndexScanProgressUpdated

Nhận cập nhật tiến độ quét chỉ mục tệp.

graphql
subscription fileIndexScanProgressUpdated {
  fileIndexScanProgressUpdated { volumeId indexed pending total state error }
}
query

indexedFileCount

Đếm tệp đã lập chỉ mục khớp truy vấn.

graphql
query indexedFileCount($query: String!) {
  indexedFileCount(query: $query)
}
query

indexedFiles

Tìm trong chỉ mục tệp đã lưu có phân trang và sắp xếp.

graphql
query indexedFiles($query: String!, $offset: Int!, $limit: Int!, $sortBy: FileSortBy!) {
  indexedFiles(query: $query, offset: $offset, limit: $limit, sortBy: $sortBy) { permission mediaId name path createdAt updatedAt size isDir }
}
mutation

pauseFileIndex

Tạm dừng lần quét chỉ mục tệp đang hoạt động.

graphql
mutation pauseFileIndex($volumeId: ID) {
  pauseFileIndex(volumeId: $volumeId)
}
mutation

rebuildFileIndex

Xây dựng lại chỉ mục tệp cho một ổ đĩa; bỏ qua volumeId hoặc truyền null để xử lý tất cả ổ đĩa đã cấu hình.

graphql
mutation rebuildFileIndex($volumeId: ID) {
  rebuildFileIndex(volumeId: $volumeId)
}
mutation

resumeFileIndex

Tiếp tục lần quét chỉ mục tệp đã tạm dừng.

graphql
mutation resumeFileIndex($volumeId: ID) {
  resumeFileIndex(volumeId: $volumeId)
}
mutation

setFileIndexVolume

Lưu chế độ lập chỉ mục và thư mục của ổ đĩa, sau đó làm mới chỉ mục của ổ đĩa.

graphql
mutation setFileIndexVolume($volumeId: ID!, $input: FileIndexVolumeInput!) {
  setFileIndexVolume(volumeId: $volumeId, input: $input)
}
mutation

stopFileIndex

Dừng lần quét chỉ mục tệp đang hoạt động.

graphql
mutation stopFileIndex($volumeId: ID) {
  stopFileIndex(volumeId: $volumeId)
}
query

fileIndexDefaults

Đọc cấu hình chỉ mục tệp mặc định.

graphql
query fileIndexDefaults {
  fileIndexDefaults { excludedDirs excludedNames mediaExcludedDirSuffixes }
}
query

fileIndexScanProgress

Đọc tiến độ quét chỉ mục tệp hiện tại.

graphql
query fileIndexScanProgress($volumeId: ID) {
  fileIndexScanProgress(volumeId: $volumeId) { volumeId indexed pending total state error }
}
query

fileIndexVolumes

Đọc các ổ chỉ mục tệp đã đăng ký cùng cấu hình.

graphql
query fileIndexVolumes {
  fileIndexVolumes { id path isAvailable indexMode includedDirs excludedDirs lastScanAt lastScanStatus }
}