Skip to content

Commit 54cd878

Browse files
committed
Add new APIs from main library
1 parent 10b64f5 commit 54cd878

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Sources/SotoElasticsearchNIOClient/SotoElasticsearchNIOClient.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ public struct SotoElasticsearchClient {
5151
self.elasticSearchClient.searchDocumentsPaginated(from: indexName, searchTerm: searchTerm, size: size, offset: offset, type: type)
5252
}
5353

54+
public func searchDocumentsCount<Query: Encodable>(from indexName: String, query: Query) -> EventLoopFuture<ESCountResponse> {
55+
self.elasticSearchClient.searchDocumentsCount(from: indexName, query: query)
56+
}
57+
58+
59+
public func searchDocumentsPaginated<Document: Decodable, QueryBody: Encodable>(from indexName: String, queryBody: QueryBody, size: Int = 10, offset: Int = 0, type: Document.Type = Document.self) -> EventLoopFuture<ESGetMultipleDocumentsResponse<Document>> {
60+
self.elasticSearchClient.searchDocumentsPaginated(from: indexName, queryBody: queryBody, size: size, offset: offset, type: type)
61+
}
62+
63+
public func customSearch<Document: Decodable, Query: Encodable>(from indexName: String, query: Query, type: Document.Type = Document.self) -> EventLoopFuture<ESGetMultipleDocumentsResponse<Document>> {
64+
self.elasticSearchClient.customSearch(from: indexName, query: query, type: type)
65+
}
66+
5467
public func deleteIndex(_ name: String) -> EventLoopFuture<ESDeleteIndexResponse> {
5568
self.elasticSearchClient.deleteIndex(name)
5669
}

0 commit comments

Comments
 (0)