Skip to content

Commit 10b64f5

Browse files
committed
Add new APIs from Elasticsearch NIO Client
1 parent b7f49e6 commit 10b64f5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/SotoElasticsearchNIOClient/SotoElasticsearchNIOClient.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ public struct SotoElasticsearchClient {
1111
self.elasticSearchClient = ElasticsearchClient(requester: requester, eventLoop: eventLoop, logger: logger, scheme: scheme, host: host, port: port, username: username, password: password, jsonEncoder: jsonEncoder, jsonDecoder: jsonDecoder)
1212
}
1313

14+
public func get<Document: Decodable>(id: String, from indexName: String) -> EventLoopFuture<ESGetSingleDocumentResponse<Document>> {
15+
self.elasticSearchClient.get(id: id, from: indexName)
16+
}
17+
1418
public func bulk<Document: Encodable>(_ operations: [ESBulkOperation<Document>]) -> EventLoopFuture<ESBulkResponse> {
1519
self.elasticSearchClient.bulk(operations)
1620
}
@@ -27,6 +31,10 @@ public struct SotoElasticsearchClient {
2731
self.elasticSearchClient.updateDocument(document, id: id, in: indexName)
2832
}
2933

34+
public func updateDocumentWithScript<Script: Encodable>(_ script: Script, id: String, in indexName: String) -> EventLoopFuture<ESUpdateDocumentResponse> {
35+
self.elasticSearchClient.updateDocumentWithScript(script, id: id, in: indexName)
36+
}
37+
3038
public func deleteDocument(id: String, from indexName: String) -> EventLoopFuture<ESDeleteDocumentResponse> {
3139
self.elasticSearchClient.deleteDocument(id: id, from: indexName)
3240
}

0 commit comments

Comments
 (0)