Liking cljdoc? Tell your friends :D

ductile.capabilities

Engine detection and capability discovery for Elasticsearch and OpenSearch

Engine detection and capability discovery for Elasticsearch and OpenSearch
raw docstring

detect-engineclj

(detect-engine cluster-info)

Inputs: [cluster-info] Returns: EngineInfo

Detect engine type and version from cluster info response.

Elasticsearch response example: {:name "node-1" :cluster_name "elasticsearch" :version {:number "7.17.0" :build_flavor "default" :build_type "docker"} :tagline "You Know, for Search"}

OpenSearch response example: {:name "node-1" :cluster_name "opensearch" :version {:distribution "opensearch" :number "2.19.0" :build_type "docker"} :tagline "The OpenSearch Project: https://opensearch.org/"}

Inputs: [cluster-info]
Returns: EngineInfo

Detect engine type and version from cluster info response.

 Elasticsearch response example:
 {:name "node-1"
  :cluster_name "elasticsearch"
  :version {:number "7.17.0"
            :build_flavor "default"
            :build_type "docker"}
  :tagline "You Know, for Search"}

 OpenSearch response example:
 {:name "node-1"
  :cluster_name "opensearch"
  :version {:distribution "opensearch"
            :number "2.19.0"
            :build_type "docker"}
  :tagline "The OpenSearch Project: https://opensearch.org/"}
sourceraw docstring

EngineInfoclj

Detected engine information

Detected engine information
sourceraw docstring

get-cluster-infoclj

(get-cluster-info {:keys [uri request-fn] :as conn})

Inputs: [{:keys [uri request-fn], :as conn} :- ESConn]

Fetch cluster info from root endpoint

Inputs: [{:keys [uri request-fn], :as conn} :- ESConn]

Fetch cluster info from root endpoint
sourceraw docstring

parse-versionclj

(parse-version version-str)

Parse version string like '2.19.0' or '7.17.0' into components Returns {:major X :minor Y :patch Z}, or nil if parsing fails

Parse version string like '2.19.0' or '7.17.0' into components
Returns {:major X :minor Y :patch Z}, or nil if parsing fails
sourceraw docstring

verify-connectionclj

(verify-connection conn)

Inputs: [conn :- ESConn] Returns: EngineInfo

Verify connection and detect engine type and version.

Usage: (def conn (es-conn/connect {:host "localhost" :port 9200})) (verify-connection conn) ;; => {:engine :opensearch ;; :version {:major 2 :minor 19 :patch 0}}

This is useful for:

  1. Auto-detecting the engine type if not specified
  2. Validating the connection configuration
  3. Getting detailed version information
Inputs: [conn :- ESConn]
Returns: EngineInfo

Verify connection and detect engine type and version.

 Usage:
   (def conn (es-conn/connect {:host "localhost" :port 9200}))
   (verify-connection conn)
   ;; => {:engine :opensearch
   ;;     :version {:major 2 :minor 19 :patch 0}}

 This is useful for:
 1. Auto-detecting the engine type if not specified
 2. Validating the connection configuration
 3. Getting detailed version information
sourceraw docstring

version-compareclj

(version-compare v1 v2)

Inputs: [v1 :- VersionInfo v2 :- VersionInfo] Returns: s/Int

Compare two version maps. Returns:

  • negative if v1 < v2
  • zero if v1 == v2
  • positive if v1 > v2
Inputs: [v1 :- VersionInfo v2 :- VersionInfo]
Returns: s/Int

Compare two version maps. Returns:
 - negative if v1 < v2
 - zero if v1 == v2
 - positive if v1 > v2
sourceraw docstring

version<?clj

(version<? v1 v2)

Inputs: [v1 :- VersionInfo v2 :- VersionInfo] Returns: s/Bool

Check if version v1 < v2

Inputs: [v1 :- VersionInfo v2 :- VersionInfo]
Returns: s/Bool

Check if version v1 < v2
sourceraw docstring

version>=?clj

(version>=? v1 v2)

Inputs: [v1 :- VersionInfo v2 :- VersionInfo] Returns: s/Bool

Check if version v1 >= v2

Inputs: [v1 :- VersionInfo v2 :- VersionInfo]
Returns: s/Bool

Check if version v1 >= v2
sourceraw docstring

VersionInfoclj

Parsed version information

Parsed version information
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