Indexer

class Indexer(context: Context, model: AiModel)(source)

One indexing pass: brings a model's EmbeddingStore in line with the library. Items that were deleted (or moved into an excluded folder) are dropped. Then photos, newest first, so search covers them within minutes; then videos, whose frames are decoded on another thread into a small queue while the model works (decoding is mostly the phone's video hardware, the model the CPU, so the two overlap almost for free). Cancellation keeps everything finished so far; the next pass carries on.

Constructors

Link copied to clipboard
constructor(context: Context, model: AiModel)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun run(limit: Int = Int.MAX_VALUE): Indexer.Outcome

Embeds at most limit items.