MossClient and MossSession.
DocumentInfo
A document stored in or returned from an index. Conforms toCodable.
| Field | Type | Description |
|---|---|---|
id | String | Unique document id. |
text | String | Document text. |
metadata | [String: String]? | Optional string key/value metadata, usable in filters. |
embedding | [Float]? | Optional pre-computed embedding. Required when the session/index uses the "custom" model. |
QueryOptions
| Field | Type | Description |
|---|---|---|
topK | Int | Number of results to return. Default 5. |
alpha | Float | Hybrid blend: 1.0 = pure semantic, 0.0 = pure keyword. Default 0.8 (semantic-heavy). |
filterJson | String? | Optional metadata filter as a JSON string ($eq, $and, $in, $near, …). |
SearchResult
Returned byquery(...).
QueryResult
A single match within aSearchResult.
ModelRef
Reference to an embedding model with version information. Surfaced onIndexInfo.
| Field | Type | Description |
|---|---|---|
id | String | Model identifier. |
version | String? | Model version (semver or build identifier). |
IndexInfo
Metadata about a cloud index. Returned bygetIndex and
listIndexes.
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the index. |
name | String | Human-readable name of the index. |
status | String | Current build status (e.g. NotStarted, Building, Ready, Failed). |
docCount | Int | Number of documents in the index. |
model | ModelRef | Embedding model bound to the index. |
version | String? | Index build/format version. |
createdAt | String? | When the index was created. |
updatedAt | String? | When the index was last updated. |
SessionOptions
Passed toMossClient.session(_:options:).
| Field | Type | Description |
|---|---|---|
modelId | String? | Embedding model id. nil = platform default (moss-litelm on iOS). Pass "custom" to supply embeddings via DocumentInfo.embedding. |
PushIndexResult
Returned byMossSession.pushIndex(). Poll
jobId with getJobStatus until
status is ready.
MutationResult
Returned by the cloud document operationscreateIndex,
addDocs, and
deleteDocs after the operation
completes.
| Field | Type | Description |
|---|---|---|
jobId | String | Identifier of the async job that performed the mutation. |
indexName | String | Name of the index that was mutated. |
docCount | Int | Number of documents in the index after the mutation. |
RefreshResult
Returned byrefreshIndex.
| Field | Type | Description |
|---|---|---|
indexName | String | Name of the index that was refreshed. |
previousUpdatedAt | String | Timestamp before the refresh. |
newUpdatedAt | String | Timestamp after the refresh. |
wasUpdated | Bool | true when a newer cloud version was applied. |
JobStatus
Returned bygetJobStatus.
MemoryPressureLevel
Passed toonMemoryPressure.
MossError
Thrown for any failure reported by the underlying runtime. Conforms toLocalizedError, so error.localizedDescription returns the message.