Liking cljdoc? Tell your friends :D

hive-milvus.store.entries

Core entry CRUD, query, search, expiry, and status helpers.

Core entry CRUD, query, search, expiry, and status helpers.
raw docstring

add-entry!clj

(add-entry! config-atom entry)
source

capabilitiesclj

What callers may rely on beyond the port. :embed-text: an entry's transient :embed-text is embedded in place of its :content and never stored.

What callers may rely on beyond the port. :embed-text: an entry's transient
:embed-text is embedded in place of its :content and never stored.
sourceraw docstring

cleanup-expired!clj

(cleanup-expired! config-atom)
source

collection-outcomeclj

(collection-outcome fetch coll-name filter-expr limit)

One collection's FanOutOutcome for a scalar query: up to limit rows matching filter-expr, read through FETCH ((fn [filter-expr page-limit] rows)).

A limit above Milvus's per-query cap is served in pages that each stay within it (enumerate/rows-matching), so a large limit returns rows, never a failure dressed as an empty result. A collection that cannot be read yields :rows [] with its :error.

One collection's FanOutOutcome for a scalar query: up to `limit` rows matching
`filter-expr`, read through FETCH (`(fn [filter-expr page-limit] rows)`).

A `limit` above Milvus's per-query cap is served in pages that each stay
within it (`enumerate/rows-matching`), so a large limit returns rows, never
a failure dressed as an empty result. A collection that cannot be read
yields `:rows []` with its `:error`.
sourceraw docstring

CollectionCountclj

source

CollectionCountFailureclj

source

delete-entry!clj

(delete-entry! config-atom id)

Delete id from every known collection. true when every collection took the delete (one that was never created has nothing to take). A collection that failed means the delete did not land, so it raises inside resilient (deleted-value): a transient cause is retried once and then answered as the hive-spi Failure map ({:success? false ...}), a fatal cause propagates as the ex-info. Never a true for a lost delete.

Delete `id` from every known collection. true when every collection took
the delete (one that was never created has nothing to take). A collection
that failed means the delete did not land, so it raises inside
`resilient` (`deleted-value`): a transient cause is retried once and then
answered as the hive-spi Failure map (`{:success? false ...}`), a fatal
cause propagates as the ex-info. Never a `true` for a lost delete.
sourceraw docstring

delete-everywhereclj

(delete-everywhere delete colls id)

Delete id from every one of colls through DELETE ((fn [coll id])).

r/ok true every collection took the delete (an unknown id included; a collection that was never created holds nothing to delete, see lookup/missing-collection?) r/err :milvus/write-incomplete {:id :failed [WriteFailure ...] :cause e} some collection did not, so the entry may survive there

Every collection is attempted even after a failure. Never throws.

Delete `id` from every one of `colls` through DELETE (`(fn [coll id])`).

  r/ok true    every collection took the delete (an unknown id included;
               a collection that was never created holds nothing to
               delete, see `lookup/missing-collection?`)
  r/err :milvus/write-incomplete {:id :failed [WriteFailure ...] :cause e}
               some collection did not, so the entry may survive there

Every collection is attempted even after a failure. Never throws.
sourceraw docstring

deleted-valueclj

(deleted-value res)

The value a delete-everywhere result answers: true, or a raised ex-info when some collection did not take the delete. Like located-value, the ex-info wraps the first failing collection's exception as its cause (so resilient classifies it) and carries :hive-milvus/failed-collections.

The value a `delete-everywhere` result answers: true, or a raised ex-info
when some collection did not take the delete. Like `located-value`, the
ex-info wraps the first failing collection's exception as its cause (so
`resilient` classifies it) and carries `:hive-milvus/failed-collections`.
sourceraw docstring

entries-expiring-soonclj

(entries-expiring-soon config-atom days opts)
source

fan-outclj

(fan-out outcomes)

Fold per-collection OUTCOMES into gathered rows and the failures that make an empty result unreliable.

Pure, and the whole of the isolation policy: a failing collection contributes whatever rows it managed and is recorded in :failed, rather than sinking the query or vanishing.

Fold per-collection OUTCOMES into gathered rows and the failures that make an
empty result unreliable.

Pure, and the whole of the isolation policy: a failing collection contributes
whatever rows it managed and is recorded in `:failed`, rather than sinking
the query or vanishing.
sourceraw docstring

FanOutclj

The rows a fan-out gathered, and the collections whose silence is unexplained by the data. :failed empty means every collection answered.

The rows a fan-out gathered, and the collections whose silence is unexplained
by the data. `:failed` empty means every collection answered.
sourceraw docstring

FanOutOutcomeclj

What one collection contributed to a fan-out: its rows, and — when it could not be reached — the message saying so. Rows and an error are not exclusive; a partial read may carry both.

What one collection contributed to a fan-out: its rows, and — when it could
not be reached — the message saying so. Rows and an error are not exclusive;
a partial read may carry both.
sourceraw docstring

find-duplicateclj

(find-duplicate config-atom type content-hash opts)
source

get-entryclj

(get-entry config-atom id)

The entry id, or nil when every known collection answered and none holds it (a configured collection that was never created answers 'none').

A collection that cannot be read is NOT absence: when no collection holds id and one failed, the read raises inside resilient (see located-value). A transient cause is retried once, then answered as {:success? false :errors [..] :reconnecting? true}; a fatal cause propagates as the ex-info. Either way, never nil.

The entry `id`, or nil when every known collection answered and none
holds it (a configured collection that was never created answers 'none').

A collection that cannot be read is NOT absence: when no collection holds
`id` and one failed, the read raises inside `resilient` (see
`located-value`). A transient cause is retried once, then answered as
`{:success? false :errors [..] :reconnecting? true}`; a fatal cause
propagates as the ex-info. Either way, never nil.
sourceraw docstring

locate-entryclj

(locate-entry fetch colls id)

Ask each of colls, in order, for id through FETCH ((fn [coll id] value-or-nil)), stopping at the first value.

r/ok value some collection answered with it r/ok nil EVERY collection answered and none holds id - absence. A configured collection that was never created counts as answered (lookup/missing-collection?): it holds nothing. r/err :milvus/read-incomplete {:id :failed [ReadFailure ...] :cause e} no value was found AND at least one collection failed, so absence cannot be told from an outage

A hit wins over a failing neighbour. Never throws: the decision is data, and located-value is the boundary that raises it.

Ask each of `colls`, in order, for `id` through FETCH
(`(fn [coll id] value-or-nil)`), stopping at the first value.

  r/ok value   some collection answered with it
  r/ok nil     EVERY collection answered and none holds `id` - absence.
               A configured collection that was never created counts as
               answered (`lookup/missing-collection?`): it holds nothing.
  r/err :milvus/read-incomplete {:id :failed [ReadFailure ...] :cause e}
               no value was found AND at least one collection failed, so
               absence cannot be told from an outage

A hit wins over a failing neighbour. Never throws: the decision is data,
and `located-value` is the boundary that raises it.
sourceraw docstring

located-valueclj

(located-value res)

The value a locate-entry result answers to a caller: the entry, nil for a true absence, or a raised ex-info for an incomplete read - never nil for a failure. ex-data carries :hive-milvus/failed-collections, the key query-entries uses.

The ex-info wraps the first failing collection's exception as its cause, so resilient classifies it by that cause: a TRANSIENT cause is retried once and, if still failing, answered as the legacy {:success? false ...} map; a FATAL cause is re-thrown by resilient (retry/classify-err), so the caller sees this ex-info.

The value a `locate-entry` result answers to a caller: the entry, nil for
a true absence, or a raised ex-info for an incomplete read - never nil for
a failure. ex-data carries `:hive-milvus/failed-collections`, the key
`query-entries` uses.

The ex-info wraps the first failing collection's exception as its cause,
so `resilient` classifies it by that cause: a TRANSIENT cause is retried
once and, if still failing, answered as the legacy
`{:success? false ...}` map; a FATAL cause is re-thrown by `resilient`
(`retry/classify-err`), so the caller sees this ex-info.
sourceraw docstring

query-entriesclj

(query-entries config-atom opts)

Fan out a scalar-filter query across every known collection.

Per-collection failures (transient transport drops, missing index, schema drift on legacy collections) are isolated: the offending coll contributes [] and the others return their hits. The failure is logged at WARN so callers don't read a silent empty result as :limit not respected (the silent-swallow used to surface as the user-visible bug 20260503012357-7d008e50).

A log line is not something a caller can branch on, so when any coll failed the returned vector also carries

^{:hive-milvus/failed-collections [{:collection name :message str} ...]}

Absent metadata means every collection answered, so an empty result is a fact about the DATA. Present metadata means the emptiness is partly an artifact of the failure, and a caller must not report it as 'nothing stored'.

Effectful boundary only — the isolation policy itself is fan-out.

Fan out a scalar-filter query across every known collection.

Per-collection failures (transient transport drops, missing index,
schema drift on legacy collections) are isolated: the offending coll
contributes [] and the others return their hits. The failure is
logged at WARN so callers don't read a silent empty result as
`:limit not respected` (the silent-swallow used to surface as the
user-visible bug 20260503012357-7d008e50).

A log line is not something a caller can branch on, so when any coll
failed the returned vector also carries

  ^{:hive-milvus/failed-collections [{:collection name :message str} ...]}

Absent metadata means every collection answered, so an empty result is a
fact about the DATA. Present metadata means the emptiness is partly an
artifact of the failure, and a caller must not report it as 'nothing
stored'.

Effectful boundary only — the isolation policy itself is `fan-out`.
sourceraw docstring

ReadFailureclj

One collection that could not answer a read.

One collection that could not answer a read.
sourceraw docstring

relocate-entry!clj

(relocate-entry! config-atom id)
(relocate-entry! config-atom id opts)

Move entry id from its current collection to the canonical target. Implements IMemoryStoreWithRouting/relocate-entry!, and with opts IMemoryStoreRoutingEmbedText/relocate-entry-with!: (:embed-text opts) is embedded in place of the stored content, and never stored.

Delegates to hive-milvus.relocate.pipeline/relocate-one, which is the CPPB-layered (Collect -> Promote -> Boundary) implementation. This wrapper unwraps the pipeline's r/ok / r/err result back into the legacy raw-map shape callers expect:

{:moved? true :from src :to target :id id} on move {:moved? false :from src :to target :id id} on no-op {:moved? false :from nil :to nil :id id :reason :not-found} when the id resolves to no collection {:moved? false :error <category> :id id :detail err-data} when the pipeline returns r/err for any other reason

Migration path: callers that want railway-tracked errors should call reloc-pipeline/relocate-one directly instead of this facade; they get an r/ok / r/err with full error context.

Move entry `id` from its current collection to the canonical target.
Implements `IMemoryStoreWithRouting/relocate-entry!`, and with `opts`
`IMemoryStoreRoutingEmbedText/relocate-entry-with!`: `(:embed-text opts)`
is embedded in place of the stored content, and never stored.

Delegates to `hive-milvus.relocate.pipeline/relocate-one`, which is
the CPPB-layered (Collect -> Promote -> Boundary) implementation.
This wrapper unwraps the pipeline's r/ok / r/err result back into
the legacy raw-map shape callers expect:

  {:moved? true  :from src :to target :id id}                on move
  {:moved? false :from src :to target :id id}                on no-op
  {:moved? false :from nil :to nil :id id :reason :not-found}
     when the id resolves to no collection
  {:moved? false :error <category> :id id :detail err-data}
     when the pipeline returns r/err for any other reason

Migration path: callers that want railway-tracked errors should
call `reloc-pipeline/relocate-one` directly instead of this
facade; they get an r/ok / r/err with full error context.
sourceraw docstring

reset-store!clj

(reset-store! config-atom)
source

scan-idsclj

(scan-ids config-atom {:keys [include-expired?]})

Every entry id across the collections this store reads, each once; expired ones only with :include-expired?. Raises rather than truncating.

Every entry id across the collections this store reads, each once; expired
ones only with :include-expired?. Raises rather than truncating.
sourceraw docstring

search-contextclj

(search-context config-atom)

The live collaborators a semantic search runs against.

The live collaborators a semantic search runs against.
sourceraw docstring

search-similarclj

(search-similar config-atom query-text opts)

Semantic search. Returns entries, best first; a failed target is carried as :hive-milvus/failed-collections metadata (see search-with).

Semantic search. Returns entries, best first; a failed target is carried
as `:hive-milvus/failed-collections` metadata (see `search-with`).
sourceraw docstring

search-withclj

(search-with ctx query-text opts)

Run a semantic search for query-text against the collaborators in ctx (see search-pipeline/context). Returns the entries, best first.

A target that fails is logged AND carried on the returned vector as

^{:hive-milvus/failed-collections [{:collection name :message str} ...]}

  • the key and shape query-entries uses. Absent metadata means every target answered, so an empty result is a fact about the data; present metadata means the result is partial and must not be reported as 'nothing matches'.
Run a semantic search for `query-text` against the collaborators in `ctx`
(see `search-pipeline/context`). Returns the entries, best first.

A target that fails is logged AND carried on the returned vector as

  ^{:hive-milvus/failed-collections [{:collection name :message str} ...]}

- the key and shape `query-entries` uses. Absent metadata means every
target answered, so an empty result is a fact about the data; present
metadata means the result is partial and must not be reported as
'nothing matches'.
sourceraw docstring

store-statusclj

(store-status config-atom)
source

StoreStatusclj

source

supports-semantic-search?clj

(supports-semantic-search? config-atom)
source

target-collection-forclj

(target-collection-for _config-atom entry)

Resolve the canonical Milvus collection for entry per current routing config (per-type → per-dim). Returns the collection name string. Implements IMemoryStoreWithRouting/target-collection-for.

Resolve the canonical Milvus collection for `entry` per current
routing config (per-type → per-dim). Returns the collection name
string. Implements `IMemoryStoreWithRouting/target-collection-for`.
sourceraw docstring

update-entry!clj

(update-entry! config-atom id updates)

Update an entry's fields. Routing-aware via the CPPB-layered pipeline — when the merged entry's target collection differs from its current collection, the pipeline relocates it transparently.

Delegates to hive-milvus.relocate.pipeline/relocate-update, which handles the COLLECT → PROMOTE → BOUNDARY flow with proper Result tracking. This wrapper unwraps the pipeline's r/ok / r/err back into the legacy raw-map shape callers expect: returns the merged entry on success, nil when id is unknown, or the update-failure map ({:error .. :reconnecting? transient?}) for downstream errors.

Migration path: callers that want railway-tracked errors should call reloc-pipeline/relocate-update directly instead of this facade.

Update an entry's fields. Routing-aware via the CPPB-layered
pipeline — when the merged entry's target collection differs from
its current collection, the pipeline relocates it transparently.

Delegates to `hive-milvus.relocate.pipeline/relocate-update`, which
handles the COLLECT → PROMOTE → BOUNDARY flow with proper Result
tracking. This wrapper unwraps the pipeline's r/ok / r/err back
into the legacy raw-map shape callers expect: returns the merged
entry on success, nil when `id` is unknown, or the `update-failure`
map (`{:error .. :reconnecting? transient?}`) for downstream errors.

Migration path: callers that want railway-tracked errors should
call `reloc-pipeline/relocate-update` directly instead of this
facade.
sourceraw docstring

update-failureclj

(update-failure id res)

The legacy error map update-entry! answers for a relocate-pipeline r/err res on id:

{:error category :id id :detail (dissoc res :error) :reconnecting? bool}

:reconnecting? says whether a retry can change the answer, the same flag resilient's failure map carries, so a queue drain re-queues only transient failures. Only a :boundary/* effect error (a Milvus call that threw) can be transient, and only when its message is a transport drop or timeout (failure/classify). Routing, embedding and collector errors are permanent. Pure.

The legacy error map `update-entry!` answers for a relocate-pipeline
r/err `res` on `id`:

  {:error category :id id :detail (dissoc res :error) :reconnecting? bool}

`:reconnecting?` says whether a retry can change the answer, the same
flag `resilient`'s failure map carries, so a queue drain re-queues only
transient failures. Only a `:boundary/*` effect error (a Milvus call that
threw) can be transient, and only when its message is a transport drop or
timeout (`failure/classify`). Routing, embedding and collector errors are
permanent. Pure.
sourceraw docstring

update-fields-keep-embedding!clj

(update-fields-keep-embedding! config-atom id updates)

Update entry fields without re-embedding.

Reads the existing record (including its :embedding vector via query-scalar), merges updates, and upserts in place via entry->record-pure with the retrieved vector. Suitable for metadata-only changes (e.g. :kg-incoming back-edge bookkeeping) where re-running the embedder on unchanged content is wasted work — and on 4096d Venice that waste blows past the 30 s memory-write timeout when an add fans out updates to multiple KG targets.

Returns the merged entry on success, nil when every known collection answered and none holds id. A collection that failed is not absence (see locate-entry / located-value): a transient cause reaches the caller as the legacy failure map from resilient, a fatal cause as the raised ex-info. Never a nil that reads as 'unknown id'.

Update entry fields without re-embedding.

Reads the existing record (including its :embedding vector via
query-scalar), merges `updates`, and upserts in place via
`entry->record-pure` with the retrieved vector. Suitable for
metadata-only changes (e.g. :kg-incoming back-edge bookkeeping)
where re-running the embedder on unchanged content is wasted work
— and on 4096d Venice that waste blows past the 30 s memory-write
timeout when an add fans out updates to multiple KG targets.

Returns the merged entry on success, nil when every known collection
answered and none holds `id`. A collection that failed is not absence
(see `locate-entry` / `located-value`): a transient cause reaches the
caller as the legacy failure map from `resilient`, a fatal cause as the
raised ex-info. Never a nil that reads as 'unknown id'.
sourceraw docstring

WriteFailureclj

One collection that did not take a write (delete).

One collection that did not take a write (delete).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close