Commit e4b0e40
authored
Merge pull request #27 from SOFTNETWORK-APP/feature/bulkFromSourceFile
Add support to bulk from multiple data sources :
#### Data Sources
| Source Type | Format | Description |
|------------------|---------------|---------------------------------------|
| **In-Memory** | Scala objects | Direct streaming from collections |
| **JSON** | Text | Newline-delimited JSON (NDJSON) |
| **JSON Array** | Text | JSON array with nested structures |
| **Parquet** | Binary | Columnar storage format |
| **Delta Lake** | Directory | ACID transactional data lake |
**Examples:**
```scala
// High-performance file indexing
implicit val options: BulkOptions = BulkOptions(
defaultIndex = "products",
maxBulkSize = 10000,
balance = 16,
disableRefresh = true
)
implicit val hadoopConf: Configuration = new Configuration()
// Load from Parquet
client.bulkFromFile(
filePath = "/data/products.parquet",
format = Parquet,
idKey = Some("id")
).foreach { result =>
result.indices.foreach(client.refresh)
println(s"Indexed ${result.successCount} docs at ${result.metrics.throughput} docs/sec")
}
// Load from Delta Lake
client.bulkFromFile(
filePath = "/data/delta-products",
format = Delta,
idKey = Some("id"),
update = Some(true)
).foreach { result =>
println(s"Updated ${result.successCount} products from Delta Lake")
}
// Load JSON Array with nested objects
client.bulkFromFile(
filePath = "/data/persons.json",
format = JsonArray,
idKey = Some("uuid")
).foreach { result =>
println(s"Indexed ${result.successCount} persons with nested structures")
}
```File tree
16 files changed
+3268
-984
lines changed- core
- src
- main/scala/app/softnetwork/elastic/client
- bulk
- file
- test/scala/app/softnetwork/elastic/client/file
- documentation/client
- es6
- jest/src/test/scala/app/softnetwork/elastic/client
- rest/src/test/scala/app/softnetwork/elastic/client
- es7/rest/src/test/scala/app/softnetwork/elastic/client
- es8/java/src/test/scala/app/softnetwork/elastic/client
- es9/java/src/test/scala/app/softnetwork/elastic/client
- project
- testkit/src/main/scala/app/softnetwork/elastic/client
16 files changed
+3268
-984
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1201 | 1201 | | |
1202 | 1202 | | |
1203 | 1203 | | |
| 1204 | + | |
1204 | 1205 | | |
1205 | 1206 | | |
1206 | 1207 | | |
1207 | 1208 | | |
1208 | 1209 | | |
1209 | | - | |
| 1210 | + | |
1210 | 1211 | | |
1211 | | - | |
1212 | | - | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
1213 | 1227 | | |
1214 | | - | |
1215 | | - | |
1216 | | - | |
1217 | | - | |
1218 | | - | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
1219 | 1237 | | |
1220 | 1238 | | |
1221 | | - | |
1222 | | - | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
1223 | 1269 | | |
1224 | 1270 | | |
1225 | 1271 | | |
| |||
1471 | 1517 | | |
1472 | 1518 | | |
1473 | 1519 | | |
1474 | | - | |
| 1520 | + | |
1475 | 1521 | | |
1476 | | - | |
| 1522 | + | |
1477 | 1523 | | |
1478 | 1524 | | |
1479 | | - | |
| 1525 | + | |
1480 | 1526 | | |
1481 | 1527 | | |
1482 | | - | |
| 1528 | + | |
1483 | 1529 | | |
1484 | 1530 | | |
1485 | | - | |
| 1531 | + | |
1486 | 1532 | | |
1487 | 1533 | | |
1488 | 1534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
Lines changed: 140 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
44 | 184 | | |
45 | 185 | | |
46 | 186 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
0 commit comments