Liking cljdoc? Tell your friends :D

milvus-clj.api

Legacy thin compat shim over milvus-clj.client.

Historical shape: a flat API of 21 functions holding a defonce singleton MilvusServiceClient. The protocol refactor (see milvus-clj.client) split the implementation into transport- specific records under milvus-clj.transport.*. This ns survives as a delegating layer so existing callers (hive-milvus is the sole consumer) need not migrate in one PR.

The singleton lives in *default-client*. connect! builds a GrpcClient via client/make and stores it. Every op reads @default-client, dispatches to the protocol method, and wraps the return in future to preserve the legacy @(milvus/...) call pattern hive-milvus depends on.

This ns will be deleted in PR-4 once all call sites migrate to milvus-clj.client/with-client.

Backward compatibility notes:

  • connect! / disconnect! / connected? preserve the old singleton lifecycle.
  • Every op still returns a future (deref with @).
  • Config keys merged via connect! pass through to milvus-clj.client/make under {:transport :grpc} defaults.
  • resolve-consistency + with-connection macro preserved (hive-milvus uses neither today, but external callers might).
Legacy thin compat shim over `milvus-clj.client`.

Historical shape: a flat API of 21 functions holding a `defonce`
singleton MilvusServiceClient. The protocol refactor (see
`milvus-clj.client`) split the implementation into transport-
specific records under `milvus-clj.transport.*`. This ns survives
as a delegating layer so existing callers (hive-milvus is the sole
consumer) need not migrate in one PR.

The singleton lives in `*default-client*`. `connect!` builds a
`GrpcClient` via `client/make` and stores it. Every op reads
`@default-client`, dispatches to the protocol method, and wraps
the return in `future` to preserve the legacy `@(milvus/...)`
call pattern hive-milvus depends on.

This ns will be deleted in PR-4 once all call sites migrate to
`milvus-clj.client/with-client`.

Backward compatibility notes:
  - `connect!` / `disconnect!` / `connected?` preserve the old
    singleton lifecycle.
  - Every op still returns a future (deref with `@`).
  - Config keys merged via `connect!` pass through to
    `milvus-clj.client/make` under `{:transport :grpc}` defaults.
  - `resolve-consistency` + `with-connection` macro preserved
    (hive-milvus uses neither today, but external callers might).
raw docstring

addclj

(add collection-name records & {:keys [upsert? partition] :or {upsert? false}})

Insert or upsert records. Returns future. Options: :upsert? (default false), :partition.

Insert or upsert records. Returns future.
Options: :upsert? (default false), :partition.
sourceraw docstring

collection-statsclj

(collection-stats collection-name)

Basic collection stats. Returns future<map>.

Basic collection stats. Returns future<map>.
sourceraw docstring

connect!clj

(connect!)
(connect! opts)

Connect to Milvus using the configured transport.

Preserved signatures: (connect!) (connect! {:host "milvus.prod" :port 19530}) (connect! {:transport :http :host "milvus.prod"})

Merges opts into milvus-clj.config (legacy flat shape), constructs the appropriate transport-specific client via milvus-clj.client/make, and stores it in the singleton default-client atom.

Returns the underlying transport-native client for backward compat:

  • gRPC: the MilvusServiceClient instance (legacy callers may hold it)
  • HTTP: the HttpClient defrecord (no legacy raw reference exists)

New code should use milvus-clj.client/with-client + protocol methods directly instead of this singleton path.

Connect to Milvus using the configured transport.

Preserved signatures:
  (connect!)
  (connect! {:host "milvus.prod" :port 19530})
  (connect! {:transport :http :host "milvus.prod"})

Merges opts into `milvus-clj.config` (legacy flat shape), constructs
the appropriate transport-specific client via `milvus-clj.client/make`,
and stores it in the singleton `default-client` atom.

Returns the underlying transport-native client for backward compat:
  - gRPC: the `MilvusServiceClient` instance (legacy callers may hold it)
  - HTTP: the `HttpClient` defrecord (no legacy raw reference exists)

New code should use `milvus-clj.client/with-client` + protocol methods
directly instead of this singleton path.
sourceraw docstring

connected?clj

(connected?)

Real liveness check — verifies the singleton client can actually reach the server, not merely that the atom holds a reference.

Caches a positive result for ~5s so a burst of consumer calls amortises to one RPC. A negative result immediately invalidates the cache so the resilience layer's reconnect loop sees the truth on its next poll.

Returns false (does NOT throw) on IO/fatal — callers reasoning about liveness want a boolean, not an exception. The reactive retry path (with-auto-reconnect) catches throws on the actual RPC site.

Real liveness check — verifies the singleton client can actually
reach the server, not merely that the atom holds a reference.

Caches a positive result for ~5s so a burst of consumer calls amortises
to one RPC. A negative result immediately invalidates the cache so the
resilience layer's reconnect loop sees the truth on its next poll.

Returns false (does NOT throw) on IO/fatal — callers reasoning about
liveness want a boolean, not an exception. The reactive retry path
(`with-auto-reconnect`) catches throws on the actual RPC site.
sourceraw docstring

consistency-levelsclj

Map keyword → ConsistencyLevelEnum (gRPC-only concept).

Map keyword → ConsistencyLevelEnum (gRPC-only concept).
sourceraw docstring

create-collectionclj

(create-collection collection-name opts)

Create a Milvus collection with schema + optional index. Returns future. See milvus-clj.client/-create-collection.

Create a Milvus collection with schema + optional index. Returns future.
See `milvus-clj.client/-create-collection`.
sourceraw docstring

create-indexclj

(create-index collection-name index-opts)

Create an index on a collection field. Returns future.

Create an index on a collection field. Returns future.
sourceraw docstring

deleteclj

(delete collection-name ids & {:keys [partition]})

Delete records by IDs. Returns future. Options: :partition.

Delete records by IDs. Returns future.
Options: :partition.
sourceraw docstring

disconnect!clj

(disconnect!)

Close the active client and clear the singleton. Idempotent.

Close the active client and clear the singleton. Idempotent.
sourceraw docstring

drop-collectionclj

(drop-collection collection-name)

Drop a collection. Returns future.

Drop a collection. Returns future.
sourceraw docstring

drop-indexclj

(drop-index collection-name field-name)

Drop an index from a collection field. Returns future.

Drop an index from a collection field. Returns future.
sourceraw docstring

flush-collectionclj

(flush-collection collection-name)

Flush collection to storage. Returns future.

Flush collection to storage. Returns future.
sourceraw docstring

getclj

(get collection-name
     ids
     &
     {:keys [include consistency-level] :or {consistency-level :strong}})

Get records by IDs. Returns future<vec>. Options: :include, :consistency-level.

Get records by IDs. Returns future<vec>.
Options: :include, :consistency-level.
sourceraw docstring

get-collectionclj

(get-collection collection-name)

Describe a collection's schema. Returns future<map>.

Describe a collection's schema. Returns future<map>.
sourceraw docstring

has-collectionclj

(has-collection collection-name)

Check if a collection exists. Returns future<boolean>.

Check if a collection exists. Returns future<boolean>.
sourceraw docstring

invalidate-probe-cache!clj

(invalidate-probe-cache!)

Force the next connected? call to re-probe. Hook for the resilience layer to call after a reactive failure so the cache stays honest.

Force the next `connected?` call to re-probe. Hook for the resilience
layer to call after a reactive failure so the cache stays honest.
sourceraw docstring

list-collectionsclj

(list-collections)

List all collection names. Returns future<vector<string>>.

List all collection names. Returns future<vector<string>>.
sourceraw docstring

load-collectionclj

(load-collection collection-name)

Load a collection into memory. Returns future.

Load a collection into memory. Returns future.
sourceraw docstring

queryclj

(query collection-name q-map)

Vector similarity search. Returns future<vec>. See milvus-clj.client/-query for q-map shape.

Vector similarity search. Returns future<vec>.
See `milvus-clj.client/-query` for q-map shape.
sourceraw docstring

query-scalarclj

(query-scalar collection-name q-map)

Scalar filter query. Returns future<vec>.

Scalar filter query. Returns future<vec>.
sourceraw docstring

release-collectionclj

(release-collection collection-name)

Release a collection from memory. Returns future.

Release a collection from memory. Returns future.
sourceraw docstring

resolve-consistencyclj

(resolve-consistency kw)

Resolve keyword to a gRPC ConsistencyLevelEnum. Nil means default.

Resolve keyword to a gRPC ConsistencyLevelEnum. Nil means default.
sourceraw docstring

with-connectioncljmacro

(with-connection opts & body)

Execute body with a temporary Milvus connection that auto-disconnects. Preserved for backward compat — new code should use milvus-clj.client/with-client.

Execute body with a temporary Milvus connection that auto-disconnects.
Preserved for backward compat — new code should use
`milvus-clj.client/with-client`.
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