Skip to content

Commit

Permalink
Merge pull request #314 from meilisearch/indexes-changes
Browse files Browse the repository at this point in the history
Indexes changes
  • Loading branch information
brunoocasali authored Aug 4, 2022
2 parents c76c37c + e5e5513 commit b9435e5
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 96 deletions.
11 changes: 6 additions & 5 deletions Sources/MeiliSearch/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public struct MeiliSearch {
public func createIndex(
uid: String,
primaryKey: String? = nil,
_ completion: @escaping (Result<Task, Swift.Error>) -> Void) {
_ completion: @escaping (Result<TaskInfo, Swift.Error>) -> Void) {
Indexes.create(uid: uid, primaryKey: primaryKey, config: self.config, completion)
}

Expand All @@ -93,8 +93,9 @@ public struct MeiliSearch {
value. If the request was sucessful or `Error` if a failure occured.
*/
public func getIndexes(
_ completion: @escaping (Result<[Index], Swift.Error>) -> Void) {
Indexes.getAll(config: self.config, completion)
params: IndexesQuery? = nil,
_ completion: @escaping (Result<Results<Index>, Swift.Error>) -> Void) {
Indexes.getAll(config: self.config, params: params, completion)
}

/**
Expand All @@ -109,7 +110,7 @@ public struct MeiliSearch {
public func updateIndex(
uid: String,
primaryKey: String,
_ completion: @escaping (Result<Task, Swift.Error>) -> Void) {
_ completion: @escaping (Result<TaskInfo, Swift.Error>) -> Void) {
self.index(uid).update(primaryKey: primaryKey, completion)
}

Expand All @@ -123,7 +124,7 @@ public struct MeiliSearch {
*/
public func deleteIndex(
_ uid: String,
_ completion: @escaping (Result<Task, Swift.Error>) -> Void) {
_ completion: @escaping (Result<TaskInfo, Swift.Error>) -> Void) {
self.index(uid).delete(completion)
}

Expand Down
Loading

0 comments on commit b9435e5

Please sign in to comment.