Skip to content

Commit

Permalink
meilisearch#22 | Add getOrCreateIndex method without primary key
Browse files Browse the repository at this point in the history
  • Loading branch information
Arjun RC committed Nov 4, 2020
1 parent b5c4880 commit 1a71145
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/com/meilisearch/sdk/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,15 @@ public Index getOrCreateIndex(String uid, String primaryKey) throws Exception {
throw e;
}
}

/**
* Get single index by uid or if it does not exists, Create index
*
* @param uid Unique identifier for the index to create
* @return Index instance
* @throws Exception If an error occurss
*/
public Index getOrCreateIndex(String uid) throws Exception {
return getOrCreateIndex(uid, null);
}
}

0 comments on commit 1a71145

Please sign in to comment.