Moss.Client and Moss.Session. Each
is a plain Elixir struct.
DocumentInfo
A document stored in or returned from an index.| Field | Type | Description |
|---|---|---|
id | String.t() | Unique document ID. |
text | String.t() | Document text. |
metadata | map() | nil | Optional string key/value metadata, usable in filters. Defaults to nil. |
embedding | [float()] | nil | Optional pre-computed embedding. Required when the index or session uses the "custom" model. Defaults to nil. |
SearchResult
Returned byquery/4 and
query/3.
| Field | Type | Description |
|---|---|---|
docs | [Moss.QueryResultDoc.t()] | Matching documents, ordered by relevance. |
query | String.t() | The query text that was run. |
index_name | String.t() | The index that was searched. |
time_taken_ms | number() | Time the query took, in milliseconds. |
QueryResultDoc
A single match within aSearchResult.
| Field | Type | Description |
|---|---|---|
id | String.t() | Document ID. |
text | String.t() | Document text. |
score | float() | Relevance score for this match. |
metadata | map() | nil | Document metadata, if any. |
IndexInfo
Metadata about a cloud or local index, returned byget_index/2,
list_indexes/1,
load_index/3, and
get_index_info/2.
| Field | Type | Description |
|---|---|---|
id | String.t() | Index identifier. |
name | String.t() | Index name. |
version | String.t() | Index version. |
status | String.t() | Current index status. |
doc_count | non_neg_integer() | Number of documents in the index. |
created_at | String.t() | Creation timestamp. |
updated_at | String.t() | Last-updated timestamp. |
model | Moss.ModelRef.t() | The embedding model the index uses. |
ModelRef
A reference to an embedding model.| Field | Type | Description |
|---|---|---|
id | String.t() | Model ID, for example "moss-minilm", "moss-mediumlm", or "custom". |
version | String.t() | Model version. |
MutationResult
Returned by cloud mutations:create_index/4,
add_docs/4, and
delete_docs/3.
| Field | Type | Description |
|---|---|---|
job_id | String.t() | ID of the async job; poll with get_job_status/2. |
index_name | String.t() | The affected index. |
doc_count | non_neg_integer() | Document count after the mutation. |
PushIndexResult
Returned byMoss.Session.push_index/1. Poll job_id
with get_job_status/2 until
status is "ready".
| Field | Type | Description |
|---|---|---|
job_id | String.t() | ID of the push job. |
index_name | String.t() | The cloud index that was created or replaced. |
doc_count | non_neg_integer() | Number of documents pushed. |
status | String.t() | Current job status. |
RefreshResult
Returned byrefresh_index/2.
| Field | Type | Description |
|---|---|---|
index_name | String.t() | The refreshed index. |
previous_updated_at | String.t() | The index timestamp before the refresh. |
new_updated_at | String.t() | The index timestamp after the refresh. |
was_updated | boolean() | Whether the refresh pulled new data. |
JobStatusResponse
Returned byget_job_status/2.
| Field | Type | Description |
|---|---|---|
job_id | String.t() | The job being polled. |
status | String.t() | Job status, for example "ready". |
progress | number() | Progress fraction. |
current_phase | String.t() | nil | Current processing phase, if any. |
error | String.t() | nil | Error message if the job failed. |
created_at | String.t() | When the job was created. |
updated_at | String.t() | When the job was last updated. |
completed_at | String.t() | nil | When the job completed, if finished. |