Skip to content

Commit 4555541

Browse files
committed
update Bulk api to support file as a source
1 parent 5380bae commit 4555541

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/src/main/scala/app/softnetwork/elastic/client/BulkApi.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ trait BulkApi extends BulkTypes with ElasticClientHelpers {
109109
}
110110

111111
// Use the existing API with the file source
112-
bulkWithResult(
112+
bulkWithResult[String](
113113
items = source,
114-
toDocument = _, // The document is already in JSON format.
114+
toDocument = identity, // The document is already in JSON format.
115115
indexKey = indexKey,
116116
idKey = idKey,
117117
suffixDateKey = suffixDateKey,
@@ -139,9 +139,9 @@ trait BulkApi extends BulkTypes with ElasticClientHelpers {
139139

140140
logger.info(s"📁 Starting bulk from Parquet file: $filePath")
141141

142-
bulkWithResult(
142+
bulkWithResult[String](
143143
items = ParquetFileSource.fromFile(filePath, bufferSize),
144-
toDocument = _,
144+
toDocument = identity,
145145
indexKey = indexKey,
146146
idKey = idKey,
147147
callbacks = callbacks
@@ -172,9 +172,9 @@ trait BulkApi extends BulkTypes with ElasticClientHelpers {
172172
JsonFileSource.fromFile(filePath, bufferSize)
173173
}
174174

175-
bulkWithResult(
175+
bulkWithResult[String](
176176
items = source,
177-
toDocument = _,
177+
toDocument = identity,
178178
indexKey = indexKey,
179179
idKey = idKey,
180180
callbacks = callbacks

0 commit comments

Comments
 (0)