Skip to content

Commit fb3a8f3

Browse files
committed
fix: ES conf can be created without a document type
1 parent 09f719d commit fb3a8f3

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* bump math.combinatorics to 0.3.2
1212

1313
### Fixed
14-
14+
* ES conf can be created without a document type
1515

1616
## [0.7.32] - 2025-10-24
1717
### Changed

src/clj/datasplash/es.clj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(ns datasplash.es
22
(:require
33
[charred.api :as charred]
4+
[clojure.string :as str]
45
[datasplash.core :as ds])
56
(:import
67
(datasplash.fns ExtractKeyFn)
@@ -24,8 +25,11 @@
2425
(defn- es-config
2526
"Creates a new Elasticsearch connection configuration."
2627
[hosts index type {:keys [username password keystore-password keystore-path]}]
27-
(let [hosts-array (into-array String hosts)]
28-
(cond-> (ElasticsearchIO$ConnectionConfiguration/create hosts-array index type)
28+
(let [hosts-array (into-array String hosts)
29+
conf (if (str/blank? type)
30+
(ElasticsearchIO$ConnectionConfiguration/create hosts-array index)
31+
(ElasticsearchIO$ConnectionConfiguration/create hosts-array index type))]
32+
(cond-> conf
2933
username (.withUsername username)
3034
password (.withPassword password)
3135
keystore-password (.withKeystorePassword keystore-password)

0 commit comments

Comments
 (0)