tencent cloud

Smart Media Hosting

Search

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2026-01-07 11:03:07

Introduction

This document provides an API overview and SDK sample code for searching files and directories.
API
Operation Description
Searching directories and files
Used to continue retrieving search results
Used to delete a search task

Searching Directories and Files

Feature Overview

Initialize search, a certain amount of search results may be returned.

Example Code

try {
val searchPartContent: SearchPartContent = smh.initSearch(
//search keywords
keyword = "keyword",
//search scope
scope = "",
//file type to search
searchTypes = listOf(SearchType.PDF)
)
//search results list view other content in SearchPartContent entity
val contents = searchPartContent.contents
} catch (e: Exception) {
e.printStackTrace()
}

Querying Search State

Feature Overview

Querying search state.

Example Code

try {
val searchPartContent: SearchPartContent = smh.searchMore(
//search id
searchId = "FnBMS09MZ2V4UzZ5RVY3NmVUX0FtemchVFZaYmdvc2hTbUtYb180NnBzY3gyQToxNDA3NzEzOTIw",
//page tag
marker = 20,
)
//search results list view other content in SearchPartContent entity
val contents = searchPartContent.contents
} catch (e: Exception) {
e.printStackTrace()
}

Completing a Search

Feature Overview

Search completed.

Example Code

try {
smh.deleteSearch(
//search id
searchId = "FnBMS09MZ2V4UzZ5RVY3NmVUX0FtemchVFZaYmdvc2hTbUtYb180NnBzY3gyQToxNDA3NzEzOTIw"
)
} catch (e: Exception) {
e.printStackTrace()
}


Ajuda e Suporte

Esta página foi útil?

comentários